Skip Menu |
 

This queue is for tickets about the Error-Return CPAN distribution.

Report information
The Basics
Id: 43402
Status: new
Priority: 0/
Queue: Error-Return

People
Owner: Nobody in particular
Requestors: d.raab [...] angel.de
Cc:
AdminCc:

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



Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 485FC19B81F4 for <bug-Error-Return [...] rt.cpan.org>; Wed, 18 Feb 2009 12:41:51 -0500 (EST)
Received: (qmail 4279 invoked by uid 103); 18 Feb 2009 17:41:51 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 18 Feb 2009 17:41:51 -0000
Received: from smtp.angel.de (HELO ht01.angel.de) (88.198.34.240) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Feb 2009 09:41:48 -0800
Received: (qmail 6516 invoked by uid 89); 18 Feb 2009 17:41:16 -0000
Received: from unknown (HELO ?192.168.168.101?) (david [...] angel.de [...] 87.139.125.155) by 0 with ESMTPA; 18 Feb 2009 17:41:16 -0000
Delivered-To: cpan-bug+Error-Return [...] diesel.bestpractical.com
Subject: context
MIME-Version: 1.0
User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)
X-Spam-Status: No, hits=0.0 required=8.0 tests=
Return-Path: <d.raab [...] angel.de>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Error-Return [...] rt.cpan.org
Date: Wed, 18 Feb 2009 18:40:50 +0100
X-Spam-Level: *
content-type: text/plain; charset="utf-8"
Message-ID: <499C4822.4000802 [...] angel.de>
To: bug-Error-Return [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: David Raab <d.raab [...] angel.de>
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 800
Download (untitled) / with headers
text/plain 800b
Error::Return does not use the return context from is "upper" function. Show quoted text
> use Error qw(:try); > use Error::Return; > > print my_localtime(), "\n"; > print scalar(my_localtime()), "\n"; > > print "\n"; > > print my_localtime2(), "\n"; > print scalar(my_localtime2()), "\n"; > > sub my_localtime { > print wantarray() ? 'array' : 'scalar', ': '; > return localtime(); > } > > sub my_localtime2 { > try { > print wantarray() ? 'array' : 'scalar', ': '; > RETURN localtime(); > }; > }
If you have something like this then in my_localtime2 the context is still a list context but it returns only the first element. Output of the above script can something like this: Show quoted text
> array: 640181811093480 > scalar: Wed Feb 18 18:40:06 2009 > > array: 640181811093480 > scalar: 6


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.