Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: (Golf) JAPH?

by dws (Chancellor)
on May 17, 2001 at 04:54 UTC ( #81136=note: print w/replies, xml ) Need Help??

in reply to (Golf) JAPH?

Going with the theory that you never really know where the lines are until you step over them, I submit die"$0\n"
Of course, the file was named "Just Another Perl Hacker" ...

Replies are listed 'Best First'.
Re: Re: (Golf) JAPH?
by MeowChow (Vicar) on May 17, 2001 at 06:15 UTC
    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...
                   s aamecha.s a..a\u$&owag.print
Re (tilly) 2: (Golf) JAPH?
by tilly (Archbishop) on May 17, 2001 at 05:54 UTC
    If you are going to go through this trouble, name the file "Just another Perl hacker,\n" and then reduce it to:
      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.

        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?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://81136]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2018-06-20 23:43 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.