Help for this page

Select Code to Download


  1. or download this
    $code .= ";\n1;";
    # ... ?
    my $perl = qx/ which perl /;
    my $result = qx/ perl -c $code /; # CAN this work? If so, how? I'm a s
    +hell-tard.
    
  2. or download this
    my $result = qx/perl -c -e '$code' 2>&1/; # bundle STDOUT and STDERR
    
  3. or download this
    -e syntax OK
    
  4. or download this
    my $result = qx/perl -c $tempfile 2>&1/;
    
  5. or download this
    package My::Eval::Evil;
    eval $code;
    ...
        ....
    }
    package main; # or whatever package you've been in
    
  6. or download this
    perl -e 'sub foo {print "foo\n" } package Foo; my $code = "*main::foo 
    += sub {print \"bar\\n\" }"; eval $code; package main; foo()'
    bar