Created
May 10, 2013 10:17
-
-
Save alexm/5553592 to your computer and use it in GitHub Desktop.
Proof of concept defining a sub with a localized global.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
local *p = sub { | |
print "[", ( join ",", @_ ), "]\n"; | |
}; | |
p(qw( foo bar )); | |
my @a = 1 .. 10; | |
p(@a); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment