What exactly did you try? Localizing *ARGV worked for me exactly as I would have thought:
$ cat ../domk.pl #!/usr/bin/perl use strict; use warnings; while (<>) { chomp; print "huzzah:".collect( $_ )."!\n"; } sub collect { local *ARGV; @ARGV = @_; join '', <>; } $ ls file? | ../domk.pl huzzah:file1 line1 file1 line2 ! huzzah:file2 line1 file2 line2 !
In reply to Re^3: How 'bout an argv pragma?
by ysth
in thread How 'bout an argv pragma?
by blazar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |