Skip Menu |

This queue is for tickets about the Devel-ArgNames CPAN distribution.

Report information
The Basics
Id: 70729
Status: new
Priority: 0/
Queue: Devel-ArgNames

People
Owner: Nobody in particular
Requestors: garu [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.03
Fixed in: (no value)



Subject: arg name only found for scalars
Hi guys. Devel::ArgNames is *brilliant* - Thanks for making and maintaining it! I was hoping to use it in Data::Printer to display variable names if the user wants to see caller information, but I might have hit a roadblock, since I just can't make it "see" any non-scalar argument. I'm not sure if this is a bug in Devel::ArgNames, in PadWalker, or not a bug at all (in which case, a little head's up in the docs would be great :) What I'm trying to do is get this function: sub foo { arg_names() } return '@array' if I say foo(@array), and return '%hash' if I say foo(%hash). Either way, attached is a failing test file with a more thorough code. Hope it helps! Again, thank you for such a terrific module, and for taking the time to look at this - I really appreciate any feedback you can provide.
Subject: 002_prototypes.t
use strict; use warnings; package Foo; use Devel::ArgNames; sub noproto { arg_names() } sub scalar_proto ($) { arg_names() } sub array_proto (@) { arg_names() } sub hash_proto (%) { arg_names() } sub multi_proto (\[$@%]) { arg_names() } package main; use Test::More tests => 9; use Devel::ArgNames; my ($scalar, @array, %hash); # this one passes is Foo::noproto( $scalar ), '$scalar', 'scalar name in unprototyped sub'; # these don't is Foo::noproto( @array ), '@array', 'array name in unprototyped sub'; is Foo::noproto( %hash ), '%hash', 'hash name in unprototyped sub'; # this one also passes is Foo::scalar_proto( $scalar ), '$scalar', 'scalar name with prototypes'; # but the following doesn't :( is Foo::array_proto( @array ), '@array', 'array name with prototypes'; is Foo::hash_proto( %hash ), '%hash', 'hash name with prototypes'; is Foo::multi_proto( $scalar ), '$scalar', 'scalar name in multi-prototyped'; is Foo::multi_proto( @array ), '@array', 'array name in multi-prototyped'; is Foo::multi_proto( %hash ), '%hash', 'hash name in multi-prototyped';