Created
September 30, 2011 13:52
-
-
Save kentfredric/1253798 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
alias 'peval'="perl -E ' | |
use 5.14.2; | |
my \$code = shift(@ARGV); | |
use strict; | |
use warnings FATAL => q[all]; | |
use Carp::Always; | |
use Try::Tiny; | |
use Data::Dump qw( dump ); | |
local \$@; | |
my \$realcode = qq[ | |
# line 1 \"(evaler)\" | |
use 5.14.2; | |
use strict; | |
use warnings FATAL => q[all]; | |
use Try::Tiny; | |
use Data::Dump qw( dump ); | |
try { | |
say dump(do { | |
# line 1 \"(userinput)\" | |
\$code | |
}) | |
} catch { | |
*STDERR->print(qq[\\\$_]) | |
}; | |
]; | |
# print \$realcode; | |
eval \$realcode; | |
if( \$@ ){ | |
*STDERR->print(qq[\$@]) | |
} | |
'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment