in reply to Perl 6 RFCs
So there are some advantages to be gained here. Problem is, if people mix standards in their code (ie using m/// when it makes things short and easy, but using match() when that makes things easy) is that going to make it harder to read code over time? (I guess that might always be a problem with backwards compatibility...)# Some become easier and more consistent... ($str = $_) =~ s/\d+/&func/ge; $str = subst /\d+/&func/ge; ($new = $old) =~ tr/a/z/; $new = trade /a/z/, $old; # And these are pretty cool... foreach (@old) { @new = subst /hello/X/gi, @old; s/hello/X/gi; push @new, $_; } foreach (@str) { @new = trade /a-z/A-Z/, @str; tr/a-z/A-Z/; push @new, $_; } $gotit = 1; print "Got it" if match /\w+/, @st +r; foreach (@str) { undef $gotis unless /\w+/; } print "Got it" if $gotit;
|
|---|