Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Data-Printer CPAN distribution.

Report information
The Basics
Id: 75963
Status: rejected
Priority: 0/
Queue: Data-Printer

People
Owner: Nobody in particular
Requestors: bitcard [...] faxm0dem.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.04
Fixed in: (no value)



Subject: Printing sub returning list only prints last element
Hi, Maybe this is a "feature", but I didn't find it in the documentation. Show quoted text
> perl -MDDP -le 'sub a {@ARGV};p a' a b c
"c" thanks
From: bitcard [...] faxm0dem.org
after looking at 'perldoc -f scalar' I realized this may be a perl "issue", as the following forces list context: # perl -MDDP -le 'sub a {@ARGV};p @{[a]}' a b c
On Thu Mar 22 07:38:41 2012, faxm0dem wrote: Show quoted text
> after looking at 'perldoc -f scalar' I realized this may be a perl > "issue", as the following forces list context: > > # perl -MDDP -le 'sub a {@ARGV};p @{[a]}' a b c
Hi! Thank you for using Data::Printer and sorry for the very long wait. Indeed printing directly from subroutine entries is not supported. You most likely already figured this out by now (again, sorry!) but the data being printed must either come from a named variable or (if you're not using prototypes) from a reference to the data. This is because of our decision to make only the first argument of p() be dumped, and treat the others as properties (e.g. p(@ARGV, colored => 0)). Hope this helps! Cheers! garu