in reply to Return values from package methods
I'm another lost soul on 5.6.1 until 5.8.1 comes out to solve the UTF problems in 5.8.0, so I verified the test case and removed some of the unnecessary complexity to get to the essense.
It turns out that the behavior you're seeing is not related to the class system. Apparently the empty function is returning its parameters, but only if it is called in list context. It returns undef if called in scalar context.
returns#!/usr/bin/perl -w use strict; use Data::Dumper; my $x = test('a', 'b'); my @y = test('a', 'b'); print Dumper( $x, \@y ); sub test {}
$VAR1 = undef; $VAR2 = [ 'a', 'b' ];
Update: s/UTC/UTF/
-- Eric Hammond
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Return values from package methods
by graff (Chancellor) on Aug 19, 2003 at 05:09 UTC | |
by esh (Pilgrim) on Aug 19, 2003 at 05:27 UTC | |
by liz (Monsignor) on Aug 19, 2003 at 06:56 UTC | |
by esh (Pilgrim) on Aug 19, 2003 at 07:29 UTC | |
by liz (Monsignor) on Aug 19, 2003 at 07:37 UTC |