in reply to Command Line Arg contains Variable and more

Not sure this will work in every arg passed

Also, doing something like this is probably not the safest

#!/usr/bin/perl use warnings; use strict; my $string = $ARGV[0]; #print "$string"; my $rc = `$string`; print $rc;

Replies are listed 'Best First'.
Re^2: Command Line Arg contains Variable and more
by ikegami (Patriarch) on Dec 11, 2009 at 21:57 UTC
    Changing
    system $cmd;
    to
    print `$cmd`;
    is never a good idea. All it does is introduce memory overhead and lag. It definitely doesn't help the OP interpolate a Perl variable into a shell command.