Keep It Simple, Stupid | |
PerlMonks |
Re: Count number of characters in a DATA blockby choroba (Cardinal) |
on Sep 04, 2022 at 17:56 UTC ( [id://11146679]=note: print w/replies, xml ) | Need Help?? |
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]
In Section
Seekers of Perl Wisdom
|
|