in reply to Re: count number of lines with +
in thread count number of lines with +

thank you for the reply. but i could not got this to work.

Replies are listed 'Best First'.
Re^3: count number of lines with +
by ladnjay (Initiate) on Jul 23, 2014 at 06:37 UTC
    String found where operator expected at 2.pl line 2, near "lne '$i++ if /^+ /}{print $i'" (Do you need to predeclare lne?) Number found where operator expected at 2.pl line 2, near "'$i++ if /^+ /}{print $i' 1" (Missing operator before 1?) syntax error at 2.pl line 2, near "lne '$i++ if /^+ /}{print $i'" Execution of 2.pl aborted due to compilation errors.
Re^3: count number of lines with +
by Anonymous Monk on Jul 23, 2014 at 10:23 UTC

    It's not a script meant to be saved to a file - it's a "one-liner", meaning a command that you enter on the command line (aka in your shell). That's the same place you would normally enter, for example, perl scriptfilename.pl