develooper Front page | perl.perl5.porters | Postings from April 2003

Re: [perl #22027] undef appears as scalar return value for a list

Thread Previous | Thread Next
From:
Mark Jason Dominus
Date:
April 24, 2003 10:40
Subject:
Re: [perl #22027] undef appears as scalar return value for a list
Message ID:
20030424174054.15483.qmail@plover.com
mike@stok.co.uk:
> > > my $rv = ('a', 'b', 'c');
> > > show $rv;
> > > my $rv2 = ('a', 'b', 'c', ());
> > > show $rv2;
> > > 
> > > I would have expected $rv2 to be 'c' as I thought ('a', 'b',
> > > 'c', ()) should be flattened to ('a', 'b', 'c').  The warnings
> > > indicate that in the first case two values are useless, and in
> > > the second three values are useless.

I'm with Mike on this.  

        my $rv2 = ('a', 'b', 'c', ());
        my $rv2 = ('a', 'b', 'c', );

These two should not be different.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About