Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 7227
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: Return-Value

People
Owner: rjbs [...] cpan.org
Requestors: rrwo [...] cpan.org
Cc:
AdminCc:

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



Subject: WISHLIST - return data other than strings
It would be nice to do something like the following: sub foo { ... my $dbh = DBI->connect(...); return success data => $dbh; } I'd like to return something other than a string, but use a simpler calling style than return Return::Value->new( bool => 1, data => $dbh, );
[guest - Mon Aug 2 22:39:51 2004]: Show quoted text
> It would be nice to do something like the following: > > sub foo { > ... > my $dbh = DBI->connect(...); > > return success data => $dbh; > }
With current (1.22) Return::Value, this is valid: sub foo { my $dbh = DBI->connect(...); return success "connected", data => $dbh; } if (my $dbh = foo) { ${$dbh}->do(...) } consult the docs on dereference overloading and the prop and data attributes.