On Tue, May 31, 2011 at 4:34 PM, Uri Guttman <[email protected]> wrote: > just to show another way that is usually faster for prepending a string: > > substr( $_, 0, 0, "$directory/" ) for @dirfiles[ 1 .. $#dirfiles ]; > > that is called 4 arg substr and it is way underused in perl. this > benchmark shows the significant speedup of about 2x:
Thanks, Uri. :) I never would have thought substr would support such a feature. In fact, I just read the perldoc and it's quite impressive how it can work as an lvalue too. That's what I love about Perl. :) -- Brandon McCaig <http://www.bamccaig.com/> <[email protected]> V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl. Castopulence Software <http://www.castopulence.org/> <[email protected]> -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
