You can try -s:
perl -sne 'split(/,/);if ($_[7] eq $arg){$cnt++;}END{print "There +are $arg things in this file\n";}' -- -arg=something file_name.txt
Note that you need -- to stop perl itself from trying to use -arg as an argument.
In reply to Re: perl command line arguments
by itub
in thread perl command line arguments
by jluther
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |