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!