Calling subroutines.

2003-08-01 Thread Andy Williams \(IMAP HILLWAY\)
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 method 1; } package MyPgk; sub METH2

Re: Calling subroutines.

2003-08-01 Thread Jasper McCrea
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 = @_;

Re: Calling subroutines.

2003-08-01 Thread Matt Lawrence
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

Re: Calling subroutines.

2003-08-01 Thread Dan Brook
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

RE: Calling subroutines.

2003-08-01 Thread Andy Williams \(IMAP HILLWAY\)
-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

Re: Calling subroutines.

2003-08-01 Thread Tim Sweetman
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