This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #114020, #90018, #53186] Make given alias $_
authorFather Chrysostomos <sprout@cpan.org>
Wed, 1 Aug 2012 21:16:21 +0000 (14:16 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 2 Aug 2012 03:38:18 +0000 (20:38 -0700)
commitb5a648148c71e82a615a5ed312204978f88e1def
tree74c539a5878b9b141394a6de59cfe1fe006b4218
parenta444d2d4f3777a58d916c57753c99c6bed6a1e5d
[perl #114020, #90018, #53186] Make given alias $_

This commit makes given() alias $_ to the argument, using a slot in
the lexical pad if a lexical $_ is in scope, or $'_ otherwise.

This makes it work very similarly to foreach, and eliminates the
problem of List::Util functions not working inside given().
perly.act
perly.h
perly.tab
perly.y
pp_ctl.c
t/op/switch.t