Created
March 17, 2009 07:58
-
-
Save anonymous/80394 to your computer and use it in GitHub Desktop.
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
package php; use File::Temp 'tempfile'; use File::Copy 'cp'; sub import { my ($pkg, $file, $m) = caller; open(my $f, $file); local $\ = "\n"; <$f> while ($m--); sysseek $f, tell($f), 0; my ($out, $php) = tempfile(UNLINK => 1); cp($f, $out); $f->close(); $out->close(); exec 'php', $php; } 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment