3 ms·
A fuller changelog is here: http://perl5.git.perl.org/perl.git/blob/HEAD:/pod/perldelta.pod http://perl5.git.perl.org/perl.git/blob/HEAD:/pod/perldelta.... The
by telemachos 15y ago
A fuller changelog is here: http://perl5.git.perl.org/perl.git/blob/HEAD:/pod/perldelta.pod http://perl5.git.perl.org/perl.git/blob/HEAD:/pod/perldelta....
There's a lot going on here, but a couple jump out at me:
* Non-destructive substitutions (with a new 'r' option)
* An experimental feature that allows you to perform operations like push, pop, splice, keys and company directly on (unblessed) array and hash references. (There's a pretty strong warning that this feature is subject to change.)
There are also enhancements for Unicode, regular expressions, exception handling and more.
- pyre 15y agoHmmm... perldoc.perl.org doesn't have 5.14 as an option yet. I assume that the 'r' option is meant to prevent things like this: my @list = (... stuff ...); my @other_list = map { s/SOMETHING//; $_ } @list; (The result of this is that @other_list and @list are equal because the substitution destructively affects the original list.)
- tedreed 15y agoThat's exactly why. (Incidentally, perlcritic will warn you if you have a map that modifies $_.)
- simcop2387 15y agoAlong with that, it's also for doing things like my $old = "foo"; my $new = $old =~ s/foo/bar/r; $old still contains "foo" and $new contains "bar", but inside a map should be great as well.
- ojosilva 15y agoThere's a more readable changelog here: http://search.cpan.org/~jesse/perl-5.14.0/pod/perldelta.pod http://search.cpan.org/~jesse/perl-5.14.0/pod/perldelta.pod