in reply to Count number of lines in a STRING

In an AWK-ish kind of way, straight from the command prompt: perl -lne "END { print $. }" myFilename

Replies are listed 'Best First'.
Re^2: Count number of lines in a STRING
by jospan (Novice) on Nov 13, 2010 at 09:33 UTC
    Sorry misread the thread: my replies gives the total number of lines in a FILE not in a STRING