On 05 Jun 2001 15:47:40 -0400, Chas Owens wrote:
> On 05 Jun 2001 12:28:01 -0700, Bob Mangold wrote:
> <snip> 
> > so then at the command line I type:
> > perl test.pl -a help, -b me, -c please
> > 
> > i even tried:
> > perl test.pl -a help -b me -c please
> <snip>
> 
> type "chmod u+x test.pl"
> then type "./test.pl"
> 
> The #!/usr/local/bin/perl tells the shell to launch perl for you
> 
> -- 
> Today is Sweetmorn, the 10th day of Confusion in the YOLD 3167
> Hail Eris!
> 

chmod u+x makes test.pl and executable file.  ./test.pl then runs it.
If you want to run one-liners type something like:

cat file | perl -e "while (<>) { print unless (/^\s*#/) }"

or the less verbose
cat file | perl -ne "print unless (/^\s*#/)"

see man perlrun or perldoc perlrun for more fun tricks

BTW: this one-liner prints all lines in file except comments 

-- 
Today is Sweetmorn, the 10th day of Confusion in the YOLD 3167
Hail Eris, Hack Linux!


Reply via email to