-
-
12 Sep 2003 14:07:43 UTC
- Distribution: Devel-Caller-Perl
- Module version: 1.4
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (2)
- Testers (3 / 0 / 0)
- Kwalitee
Bus factor: 0- License: perl_5
- Activity
24 month- Tools
- Download (2.52KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Devel::Caller::Perl - Perl only implementation.
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
Module Install Instructions
To install Devel::Caller::Perl, copy and paste the appropriate command in to your terminal.
cpanm Devel::Caller::Perl
perl -MCPAN -e shell install Devel::Caller::Perl
For more information on module installation, please visit the detailed CPAN module installation guide.