[Melbourne-pm] Just how much does $& slow things down?

Leigh Sharpe lsharpe at pacificwireless.com.au
Thu Nov 20 19:59:35 PST 2008


> Do you have to use $&, or can you use ${^MATCH} instead? (Which
> come with the global performance impact)

Actually, no. In this case, it's actually quite easy to put paranthesis
in the regex and then use $1, $2 etc. Looks like it saves around 0.1
seconds per iteration, which makes me wonder if it was worth bothering

${^MATCH} isn't much use to me in this case either, I'm using 5.8.

More information about the Melbourne-pm mailing list