I submit that the following is shorter:
perl -pee
Then start pressing the following keys: 'J', 'u', 's', 't' SPACE, 'A', 'n', 'o', 't', 'h', 'e', 'r', SPACE, 'P', 'e', 'r', 'l', SPACE, 'H', 'a', 'c', 'k', 'e', 'r', ENTER. Japhage magically occurs...
MeowChow
s aamecha.s a..a\u$&owag.print | [reply] [d/l] |
If you are going to go through this trouble, name the file
"Just another Perl hacker,\n" and then reduce it to:
die$0
| [reply] [d/l] |
Not quite. You need the "\n" at the end of the die() argument to keep it from spitting out the filename (again) and line number.
| [reply] [d/l] |
I didn't miss that detail. Here is a Perl program that
both writes and runs the script under Unix:
my $filename = "Just another Perl hacker,\n";
open (OUT, "> $filename\0") or die "Cannot write '$filename': $!";
print OUT 'die$0';
close OUT;
system "perl '$filename'";
Do you see where the return is coming from now? | [reply] [d/l] |