This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for given aliasing $_
authorFather Chrysostomos <sprout@cpan.org>
Thu, 2 Aug 2012 05:03:34 +0000 (22:03 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 2 Aug 2012 17:02:03 +0000 (10:02 -0700)
pod/perldelta.pod

index be42f56..dd55363 100644 (file)
@@ -61,6 +61,13 @@ C<utf8::downgrade> works, that result is used; otherwise, the equivalent of
 C<utf8::encode> is used, and a warning is issued about wide characters
 (L</Diagnostics>).
 
+=head2 C<given> now aliases the global $_
+
+Instead of assigning to an implicit lexical $_, C<given> now makes the
+global $_ an alias for its argument, just like C<foreach>.  However, it
+still uses lexical $_ if there is lexical $_ in scope (again, just like
+C<foreach>).
+
 =head1 Deprecations
 
 XXX Any deprecated features, syntax, modules etc. should be listed here.