in reply to (ar0n) Re: Moving Input Data Files into Script Proper.
in thread Moving Input Data Files into Script Proper.

And if you push:
push(@ARGV, glob("/home/dir/myinput/*"));
You get the added bonus of being able to run the script with -d (and other switches) for debugging without having to recode that bit. The filenames just get added onto the end.

Replies are listed 'Best First'.
(tye)Re: Moving Input Data Files into Script Proper.
by tye (Sage) on Jun 17, 2001 at 23:24 UTC

    If you are talking Perl's debugger, then changing @ARGV won't have any effect on the -d switch that enables this. @ARGV is the arguments passed to the Perl script and doesn't include (nor modify) the switches and arguments passed to the perl executable (such as -w, -d, or which script to run).

            - tye (but my friends call me "Tye")
      The point was that pushing (as opposed to assigning) into @ARGV doesn't interfere with any argument processing -- yours (Getopt) or Perl's (-laneipdw0...). Whatever you push will just get processed at the end of whatever you typed which is what he wanted...