Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Which way is recommended ?

by jeffa (Chancellor)
on Nov 21, 2008 at 18:52 UTC ( #725206=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Which way is recommended ?
in thread Which way is recommended ?

Exactly. If you are feeling (over)confident you can just code this:

open (FILE, $filename) or die $!; print while <FILE>;

Or on the command line:

perl -pe '$_' file.txt

UPDATE: thanks for the correction, quester

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)


Comment on Re^3: Which way is recommended ?
Select or Download Code
Re^4: Which way is recommended ?
by quester (Vicar) on Nov 22, 2008 at 07:56 UTC
    Pardon me, but even one liners need to enable warnings...
    $ perl -wpe '$_' file.txt Useless use of a variable in void context at -e line 1. ...
    It should actually just be
    $ perl -wpe '' file.txt

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (17)
As of 2014-07-22 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (126 votes), past polls