in reply to how to deal with incorrect command line argument
Perhaps the following will be helpful:
use strict; use warnings; my @array; for (@ARGV) { if (-e) { push @array, $_; next; } warn qq{"$_" doesn't exist!}; } @ARGV = @array; print "@ARGV";
This pushes the 'good' params onto @array and warns on the others, then reinitializes @ARGV with the 'good' ones.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how to deal with incorrect command line argument
by marinersk (Priest) on Oct 31, 2013 at 00:23 UTC | |
by Kenosis (Priest) on Oct 31, 2013 at 01:34 UTC | |
by marinersk (Priest) on Oct 31, 2013 at 19:32 UTC | |
by muba (Priest) on Oct 31, 2013 at 21:13 UTC | |
by marinersk (Priest) on Oct 31, 2013 at 21:28 UTC | |
| |
by Kenosis (Priest) on Oct 31, 2013 at 19:34 UTC | |
Re^2: how to deal with incorrect command line argument
by scripter87 (Novice) on Oct 30, 2013 at 22:28 UTC | |
by Kenosis (Priest) on Oct 30, 2013 at 22:37 UTC |