Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re (tilly) 2: (Golf) JAPH?

by tilly (Archbishop)
on May 17, 2001 at 05:54 UTC ( #81146=note: print w/replies, xml ) Need Help??


in reply to Re: (Golf) JAPH?
in thread (Golf) JAPH?

If you are going to go through this trouble, name the file "Just another Perl hacker,\n" and then reduce it to:
die$0

Replies are listed 'Best First'.
Re: Re (tilly) 2: (Golf) JAPH?
by dws (Chancellor) on May 17, 2001 at 05:58 UTC
    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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://81146]
help
Chatterbox?
[GotToBTru]: I appreciate the ability to highlight matching brackets/ parentheses/ braces, both for my own code and the inconsistently indented code of others
[Corion]: I like editors that automatically highlight the matching parenthesis (like % in vi), but that's roughly the extent to which I like editor support ;)
[GotToBTru]: same here Corion.
[Corion]: I tried for a short time (well, 8 hours now) to get Perl::Tidy set up but then found that it doesn't support (new-style) signatures and then stopped again ;))
[GotToBTru]: changing the font color of the rest of the document just because I typed a single quote character is annoying

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-02-27 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (385 votes). Check out past polls.