in reply to Perl as a command executor (with hash variable substitution)
WARNING WARNING WARNING
We are opening Pandora's box. All the following is never recommended.
#!/usr/bin/perl use warnings; use strict; our %TESTHASH = ( 'KEY1' => 'VALUE1', 'KEY2' => 'VALUE2', ); foreach my $arg (@ARGV) { my $toeval = '"' . $arg .'";'; print $toeval, "\n"; my $command = eval $toeval; print $command, "\n"; system($command); print "\n"; }
But you've asked... ;-)
McA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl as a command executor (with hash variable substitution)
by RecursionBane (Beadle) on Mar 21, 2013 at 21:16 UTC |