On Fri, Oct 24, 2003 at 12:57:18AM -0600, Luke Palmer wrote:
> Presuming you can do:
> 
>     (who => $name, why => $reason) := (why => $because, who => "me");
> 
> (from A6)
> 
> Does that imply that you can do:
> 
>     sub routine (name => $nombre, date => $fecha) {...}
> 
> Anyway, I just realized that this is finally an elegant way to do
> multiple, unordered return values:
> 
>     (name => $name, id => $id) := getinfo();
> 
> (Or, in this precise case:)
> 
>     (+$name, +$id) := getinfo();


Just confirming something...if you did this:

     ($name, $id) := &getinfo();

I think you would end up storing an alias to the getinfo() sub in $name, and
undef in $id.  Is that correct?

What would happen if you did this?

     (+$name, +$id) := &getinfo();

I would expect a compile time error, because you can't bind a sub
alias to a scalar that is being forced into numeric context.

--Dks

Reply via email to