[Kochi-pm] caller - a perl subroutine which we normally wont make note of.
vctheguru at gmail.com
Wed Nov 4 20:11:48 PST 2009
I am trying to introduce you to a Perl function '*caller*' which most of
us didn't pay attention to. I do remember I used it long back, but never
used for last 4 years.
caller is a perl built-in function. It returns the context of function
call in any subroutine.
( $package, $filename, $line, $subroutine, $hasargs,
$wantarray, $evaltext, $is_require, $hints, $bitmask, $hinthash ) = caller(1);
The only expression it takes is an integer. Value 1 means, returns the
details of the function called current function.
For more details, you may read http://perldoc.perl.org/functions/caller.html
May be at some point you may need it :)
Thanks and Regards
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Kochi-pm