Skip to content

Instantly share code, notes, and snippets.

Created March 17, 2009 07:58
Show Gist options
  • Save anonymous/80394 to your computer and use it in GitHub Desktop.
Save anonymous/80394 to your computer and use it in GitHub Desktop.
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