Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Count number of characters in a DATA block

by choroba (Cardinal)
on Sep 04, 2022 at 17:56 UTC ( [id://11146679]=note: print w/replies, xml ) Need Help??


in reply to Count number of characters in a DATA block

No, it reads all the lines, but only reports the result for the last one.

To report the number for each line, move the final print inside the loop.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Count number of characters in a DATA block
by Trudge (Acolyte) on Sep 04, 2022 at 18:10 UTC
    Ah yes. And to get the total:
    $PipeCounterTotal+=$PipeCounter;
    Thank you for the quick response!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-20 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found