in reply to Re^3: how to find the length of any line of file -- oneliner
in thread how to find the length of any line of file

Hello Laurent_R, curiously enough (for me!)

 perl -lne  "print length  and exit if $. == $ARGV[0]"  datatest.txt 4

does not complains about: Can't open 4: No such file or directory at.. and works even without the BEGIN block

It just runs ok with both passed as arguments, not with the data passed via pipe though.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.