GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DEVEL::CALLER::PERL (3)

.ds Aq ’

NAME

Devel::Caller::Perl - Perl only implementation.

CONTENTS

SYNOPSIS



 use Devel::Caller::Perl qw[called_args];

 sub permute_args {
   my @args = @_;
   my @caller_args = called_args( 0 );
  
   my %caller_args =
     map { $_ => $caller_args[$_] } 0 .. $#caller_args;
  
   return \%caller_args;
 }

 sub dodad {
   my $args = permute_args;

   print $args->{0};
   # ...
 }



ABSTRACT

This module allows a method to get at arguments passed to subroutines higher up in the call stack.

DESCRIPTION

    FUNCTIONS

called_args [LEVEL]

called_args returns the arguments to the subroutine at LEVEL in the call stack. If no level is specified, 0 (zero) is assumed, that being our caller. If a list is expected, it will be returned. When a scalar is expected, a list reference will be returned.

If you want the number of arguments passed to the subroutine at LEVEL, there’s nothing stopping you from getting it from caller.



 my $number = (caller $level)[4];



AUTHOR

Casey West <casey@geeknest.com>

THANKS

Rocco Caputo — Much help with code and overall inspiration.

COPYRIGHT

Copyright (c) 2003 Casey West. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

perl, Devel::Caller, DB, perldebguts.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DEVEL::CALLER::PERL (3) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.