Re: how can i untain $ARGV from a perl script extending snmp?



Jordi Moles Blanco schreef:

my $path = $ARGV[3];

my ($path) = $ARGV[3] =~
m{ ^ # SOB
( # start capturing
(?: # start group
/ # a slash
[a-z]+ # followed by 1 or more lowercase letters
) # end group
+ # the group 1 or more times
) # end capturing
$ # EOB
}x;

or in shorthand:

my ($path) = $ARGV[3] =~ m{^((?:/[a-z]+)+)$};

$path or die "bad path";

(untested)

--
Affijn, Ruud

"Gewoon is een tijger."
.



Relevant Pages