This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for split-to-array
authorFather Chrysostomos <sprout@cpan.org>
Mon, 13 Oct 2014 06:16:35 +0000 (23:16 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 13 Oct 2014 06:26:19 +0000 (23:26 -0700)
4ecee20 op.c: Distangle split and common-vars
fd017c0 Optimise @lexarray = split...
ef7999f Optimise my(@array)=split
4574270 opt.t: Test split-to-array optimisation

pod/perldelta.pod

index 2c35b1e..5feaf4a 100644 (file)
@@ -135,6 +135,14 @@ Non-magical/non-tied scalars that contain only a floating point value and are
 on most Perl builds with 64 bit integers now use 8-32 less bytes of memory
 depending on OS.
 
+=item *
+
+In C<@array = split>, the assigment can be optimised away with C<split>
+writing directly to the array.  This optimisation was happening only for
+package arrays other than @_ and only if the argument to split was an
+explicit constant or scalar other than $_.  Now this optimisation happens
+almost all the time.
+
 =back
 
 =head1 Modules and Pragmata