in reply to How can I write this in a "simpler" way?
How about:
(Use single-quotes for Linux).perl -nE "$s+=$_}{say qq|total $s|" myfile.txt
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
|
---|
In Section
Seekers of Perl Wisdom