in reply to Re^2: How 'bout an argv pragma?
in thread How 'bout an argv pragma?
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 !
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How 'bout an argv pragma?
by blazar (Canon) on May 28, 2008 at 10:01 UTC | |
by ysth (Canon) on May 29, 2008 at 01:53 UTC | |
by blazar (Canon) on May 29, 2008 at 16:57 UTC | |
by ysth (Canon) on May 29, 2008 at 20:07 UTC | |
by tye (Sage) on May 30, 2008 at 01:33 UTC | |
by blazar (Canon) on May 30, 2008 at 08:39 UTC |