[Chicago-talk] Finding out where a sub is called from

Shawn Carroll shawn.c.carroll at gmail.com
Mon Feb 16 05:53:31 PST 2009


http://perldoc.perl.org/functions/caller.html

On Mon, Feb 16, 2009 at 7:49 AM, Richard Reina
<richard at rushlogistics.com> wrote:
> Is there a type of variable that can tell me where a subroutine was called from?
>
> For example if I do:
>
> #!/usr/bin/perl -w
> # caller.pl
> require "./script.pl";
> my $result = do_it();
>
>
> #!/usr/bin/perl -w
> # script.pl
>
> sub do_it {
>
> # who called for me?
>
> }
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>



-- 
shawn.c.carroll at gmail.com
Perl Programmer
Soccer Referee


More information about the Chicago-talk mailing list