Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^3: Command-line arguments to command-line Perlby morgon (Priest) |
on Oct 03, 2010 at 23:04 UTC ( [id://863210]=note: print w/replies, xml ) | Need Help?? |
I think you don't really understand what -p does. I recommend that you read about it in "perldoc perlrun". In your example you seem to expect that "ConfigFile" is treated as the name of the file that -p workes on and all the other command-line arguments go to @ARGV. This is wrong. What happens is that ALL arguments (including "ConfigFile") go to @ARGV but then are treated (via -p's magic) as filenames. This is why you get the error. So you have to pass your data to perl via some other mechanism if you want to use -p (I would use an environment variable).
In Section
Seekers of Perl Wisdom
|
|