Created
May 3, 2011 05:29
-
-
Save kentfredric/952859 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 strict; | |
| use warnings; | |
| { | |
| package Foo; | |
| use Data::Dump qw( dump ); | |
| use Symbol; | |
| sub run { | |
| my $s = Symbol::gensym; | |
| ${*$s}{pea} = 'nut'; | |
| dump $s; | |
| return; | |
| } | |
| } | |
| Foo::run; |
This file contains hidden or 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
| do { | |
| require Symbol; | |
| my $a = Symbol::gensym(); | |
| *{$a} = { pea => "nut" }; | |
| $a; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment