Andy Williams (IMAP HILLWAY) wrote:
Hi,
I want to be able to do something like the following:
perl
my $method = shift(@ARGV);
my @vars = @ARGV;
eval {
$method(@vars);
};
if ($@) {
die Method doesn't exist;
}
sub METH1 {
my @passed_vars = @_;
Andy Williams (IMAP HILLWAY) wrote:
Hi,
I want to be able to do something like the following:
perl
my $method = shift(@ARGV);
my @vars = @ARGV;
eval {
$method(@vars);
};
if ($@) {
die Method doesn't exist;
}
sub METH1 {
my @passed_vars = @_;
print Welcome to
I realise that what is passed could be tainted and need to check for
that, I was just wondering if there was a nice way of doing this or
whether I should do it at all?
Maybe not a 'nice' approach, but definitely effective in this case,
would walking the main stash. So something like this would
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Matt Lawrence
Sent: 01 August 2003 16:20
To: [EMAIL PROTECTED]
Subject: Re: Calling subroutines.
A nice simple way of doing that would be to have a hash of
valid values
for $method.
my %valid
Andy Williams (IMAP HILLWAY) wrote:
Great thanks.
I had thought of doing that but it needs to know about subroutines that
another programmer may put in an entirely different package. (Basically
I will be the only one to have access to this code).
Er... you seem confused. If you're the only one