>I don't want to jam a list into anything. I want it to remain a list.

Then it won't fit.  Don't you understand?  YOU CANNOT LET IT REMAIN
A LIST AND PUT ALL THOSE THINGS IN A SCALAR SLOT.

>       sub fn { return (3,5,7) }
>       $x = fn;        # I want  $x==3

Why should it return the first one?  It returns the last one!
It's just doing what you told it, which was:

    $x = 3;
    $x = 5;
    $x = 7;

and you're left with 7.

This is not a new concept, nor an isolated one.  Here's another list:

    $x = @ENV{HOME,USER,TERM};

which is

    $x = $ENV{HOME};
    $x = $ENV{USER};
    $x = $ENV{TERM};

Of course you get the last one.   You don't get the first one.  You don't
get the count.  Sure, there are functions that can do those things, but
these aren't functions who get to be quirky.  This is completely expected.
 
--tom

Reply via email to