Gets input from user (i.e, from STDIN)
my @array = grep { /^\+\s+/, print $_ } <> ; print scalar @array;
If you pass the file name as command line argument also this script works, <> will check for @ARGV array for input file.So if you call this script as perl pattenmatch.pl filename.txtwhatever is in @ARGV is used instead.
In reply to Re: count number of lines with +
by vinoth.ree
in thread count number of lines with +
by ladnjay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |