in reply to Re: Return values from package methods
in thread Return values from package methods

In 5.6.0 on AIX, I did:
#!/usr/bin/perl use Data::Dumper; my $test = Test->new; $test->xyz; my $a = $test->test(1); my $b = \$test->test(2); print Dumper( $test->test(3) ); print Dumper( $a ); print Dumper( $b ); exit 0; package Test; use strict; sub new { return bless {}, shift; } sub xyz { (1..3) } sub test { } 1; __END__ ----- $VAR1 = bless( {}, 'Test' ); $VAR2 = 3; $VAR1 = undef; $VAR1 = \2;

It looks like the implicit return in list context, barring no other statements, is @_. Having an intervening statement didn't do anything.

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.