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.

#!/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 {}
returns
$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
    I'm another lost soul on 5.6.1 until 5.8.1 comes out to solve the UTC problems in 5.8.0

    Are the "UTC problems in 5.8.0" really so bad? For sure, 5.8.1 will fix bunch of things, but these are a fairly small and abstruse set, compared to the set of things that 5.8.0 does right and 5.6.1 doesn't do at all (or does wrong).

      (OFF TOPIC)

      Unfortunately, our users kept hitting a UTF-8 problem on our web site which made it unusable (even though we are not using UTF anywhere in our code). Everything works smoothly on 5.6.1.

      We tried very hard with help from the community to solve the problems or find workarounds, but were eventually told that this specific problem would be fixed in the next release.

      We wait patiently and eagerly.

      Update: s/UTC/UTF/ per liz.

      -- Eric Hammond

        UTC-8? You mean UTF-8?

        Are you running Red Hat? Then your problems may be solved by ensuring the the environment is not forcing Unicode on Perl. If I remember correctly, this was done with:

        LC_LANG=C
        
        but please check out Google Groups for this.

        Liz