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.
In reply to Re: how to deal with incorrect command line argument
by Kenosis
in thread how to deal with incorrect command line argument
by scripter87
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |