in reply to Accessing a scalar value in another subroutine?
sub method1 { my $self = shift; my $docstring = "Prints information about X, Y, and Z"; # ... } sub help { my $self = shift; my $method = shift; # Note: The following approach does not work. # I tried inserting the package name before the method name, i.e., + $package_name::method::docstring, but that too was unsuccessful. + # print $method::docstring, "\n"; } <br/> <br/> Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Accessing a scalar value in another subroutine?
by LanX (Saint) on Sep 23, 2012 at 20:03 UTC |