Take a look at the documentation for the -p and -n switches in perlrun. In prasee er...short, it says
-p
causes Perl to assume the following loop around your program, which ma
+kes it iterate over filename arguments somewhat like sed:
LINE:while (<>) { # your program goes here }
continue { print or die "-p destination: $!\n"; }
If you substitute the 'program' eg. "}{die" where the comment above says " your program goes here", then you willl see how the thing works.
Examine what is said, not who speaks.
The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead. |