#!/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;