Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: print source golf

by Corion (Pope)
on Oct 14, 2019 at 16:21 UTC ( #11107432=note: print w/replies, xml ) Need Help??


in reply to print source golf

How about this?

#!perl open 0;print for<0>;

This takes advantage of

  • Single-argument open opens a filehandle *X using the value stored in $X as the filename. Since $0 contains the filename of our program, *0 will be opened as our filehandle.

  • print for<0>; reads from filehandle *0 and prints the content.

Replies are listed 'Best First'.
Re^2: print source golf
by tobyink (Canon) on Oct 14, 2019 at 21:10 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2020-01-28 18:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?