suaveant has asked for the wisdom of the Perl Monks concerning the following question:
it works fine but when I doreturn &$ref;
Any idea what I am doing wrong, since this second way makes weird things happen, which tell me some data isn't getting returned right...my @a; if(wantarray) { @a = &$ref; } else { $a[0] = &$ref; } ... do something ... return @a; #or return wantarray ? @a : $a[0];
- Ant
- Some of my best work - Fish Dinner
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Returning data from wrapped sub
by dragonchild (Archbishop) on Aug 30, 2001 at 00:59 UTC | |
|
(tye)Re: Returning data from wrapped sub
by tye (Sage) on Aug 30, 2001 at 02:48 UTC | |
|
(jeffa) Re: Returning data from wrapped sub
by jeffa (Bishop) on Aug 30, 2001 at 00:40 UTC | |
by suaveant (Parson) on Aug 30, 2001 at 00:47 UTC | |
by jeffa (Bishop) on Aug 30, 2001 at 00:53 UTC | |
by japhy (Canon) on Aug 30, 2001 at 00:57 UTC | |
by tilly (Archbishop) on Aug 30, 2001 at 05:20 UTC | |
by suaveant (Parson) on Aug 30, 2001 at 01:09 UTC |