perlUser9 has asked for the wisdom of the Perl Monks concerning the following question:
package Module1; sub new { my $class = shift; my $self = {}; bless($self, $class); return $self; } sub allVars($no1) { my ($self, $no1, $no2, $name1, $name2) = @_; print "all vars = $no1 $no2 $name1 $name2\n"; } 1;
I want to list the arguments of allVars that is - $no1, $no2, $name1 and $name2. I tried using symbol table of Perl. But I could extract only the methods of my module.
Is there any way to list arguments of a method using symbol table? Is there any Perl Module I can use?foreach my $key (sort keys %Module1::) { print $key ==> will return all methods of Module1 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: List arguments of a method
by davido (Cardinal) on May 15, 2014 at 06:20 UTC | |
|
Re: List arguments of a method
by tobyink (Canon) on May 15, 2014 at 08:43 UTC | |
|
Re: List arguments of a method
by kcott (Archbishop) on May 15, 2014 at 06:31 UTC | |
|
Re: List arguments of a method
by moritz (Cardinal) on May 15, 2014 at 09:10 UTC | |
by tobyink (Canon) on May 15, 2014 at 09:27 UTC | |
|
Re: List arguments of a method
by andal (Hermit) on May 15, 2014 at 06:27 UTC | |
|
Re: List arguments of a method
by LanX (Saint) on May 15, 2014 at 10:37 UTC |