Created
November 26, 2011 02:52
-
-
Save rsimoes/1394874 to your computer and use it in GitHub Desktop.
javascript in perl
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
use strict; | |
use warnings; | |
use subs::auto; | |
my %vars; | |
sub var (*) :lvalue { | |
my $var = shift; | |
no strict 'refs'; | |
no warnings 'redefine'; | |
*{$var} = sub { (\%vars)->{$var}; }; | |
$vars{$var}; | |
} | |
sub alert { print @_, "\n" }; | |
var foo = 'bar'; | |
alert(foo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment