[Kochi-pm] caller - a perl subroutine which we normally wont make note of.
Varghese Chacko
vctheguru at gmail.com
Wed Nov 4 20:11:48 PST 2009
Hi all,
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.
Syntax:
( $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
Varghese Chacko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/kochi-pm/attachments/20091105/509341eb/attachment.html>
More information about the Kochi-pm
mailing list