Perl-Sensitive Sunglasses | |
PerlMonks |
Re^4: Command-line arguments to command-line Perlby RecursionBane (Beadle) |
on Oct 04, 2010 at 04:57 UTC ( [id://863249]=note: print w/replies, xml ) | Need Help?? |
Thank you, suhailck! This tactic worked for me; I'd never have thought to use BEGIN() to stall the argument preprocessor until specific args could be gathered before allowing the program to proceed (and thereby still keeping the ability to auto-parse all supplied files "in-line")! This is what my one-liner now looks like: perl -pi -e 'BEGIN {$design = pop}; s/'def'.*''/\t"def" => "dumper\/$design.def",/g' ConfigFile ADCIF The main advantage here is that I can supply "ConfigFile1 ConfigFile2 ... ConfigFileN ADCIF" (or, indeed, "ConfigFile* ADCIF") to have the change applied to all of them. Thanks again for your solution! ~RecursionBane
In Section
Seekers of Perl Wisdom
|
|