I stand corrected. Thanks, itub and Roy Johnson. Normally I do this in two phases (the match, then the substitution), but that's just me, and not something to advocate as the One True Perl Way. :-) I just find it makes more sense, but largely because I forget about s returning the number of matches, which is largely due to lack of need (usually I do the substitution and continue without any branching on whether it was succesful or not).
In reply to Re^5: Stupid mistakes I repeatedly make
by Tanktalus
in thread Stupid mistakes I repeatedly make
by brian_d_foy
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |