Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How can I write this in a "simpler" way?

by NetWallah (Abbot)
on Feb 12, 2014 at 00:10 UTC ( #1074553=note: print w/ replies, xml ) Need Help??


in reply to How can I write this in a "simpler" way?

How about:

perl -nE "$s+=$_}{say qq|total $s|" myfile.txt
(Use single-quotes for Linux).

        What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
              -Larry Wall, 1992


Comment on Re: How can I write this in a "simpler" way?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2015-08-01 01:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls