# With Perl's -s switch $ ./anWithArgs.pl -type=letters input.txt $ cat anWithArgs.pl #!/usr/bin/perl -sn if ( $type eq 'letters' ) { print if /[[:alpha:]]/; } elsif ( $type eq 'numbers' ) { print if /\d/; } else { print "bad type: $type" }
In reply to Re: custom args with perl -an type invocation?
by jwkrahn
in thread custom args with perl -an type invocation?
by tphyahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |