in reply to Re: getting a subroutine's name
in thread getting a subroutine's name
the-calling-subroutine-name main, directory/program.pl,line,main::the-calling-subroutine-name
even this code works fine if I am not calling from within a subroutine the addem() function,#works fine sub addem{ ($value1, $value2)=@_; $value1+$value2; print join(':',caller); # ($package, $filename, $line)=caller; }
so I don't really understand the behavior, tried getting a diagnosis using eval function but did not work out..........#notice disablement of the blocks in the callingfun() makes it work sub addem{ ($value1,$value2)=@_; $value1+$value2; print join(',',caller); } #sub callingfun{ $result = addem(2,2); # }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: getting a subroutine's name
by shmem (Chancellor) on Jul 17, 2009 at 19:20 UTC | |
by biohisham (Priest) on Jul 17, 2009 at 19:52 UTC |