Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: print source golf

by davido (Cardinal)
on Oct 15, 2019 at 15:43 UTC ( [id://11107489]=note: print w/replies, xml ) Need Help??


in reply to print source golf

Is it cheating to use the shell?

#!/usr/bin/perl exec"cat $0"

If you're ok with letting the output happen on STDERR instead of STDOUT:

#!/usr/bin/perl die`cat $0`

...which shaves off one keystroke.


Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11107489]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-03-29 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found