PerlingTheUK has asked for the wisdom of the Perl Monks concerning the following question:
I have a function that got a reference to an array passed. I wanted to get the array using
The interpreter tells me this is ambiguous. Replacing @{ shift } with @{ shift() } works fine. Yet I cannot see the ambiguity of the first statement. Can anyone explain the other meaning to me?sub my_func{ @vals = @{ shift }; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ambiguity of @{ shift }
by davido (Cardinal) on Sep 24, 2004 at 07:14 UTC | |
|
Re: Ambiguity of @{ shift }
by Corion (Patriarch) on Sep 24, 2004 at 07:09 UTC | |
|
Re: Ambiguity of @{ shift }
by TimToady (Parson) on Sep 24, 2004 at 23:01 UTC | |
|
Re: Ambiguity of @{ shift }
by Zaxo (Archbishop) on Sep 24, 2004 at 07:15 UTC | |
|
Re: Ambiguity of @{ shift }
by Juerd (Abbot) on Sep 24, 2004 at 11:39 UTC | |
|
Re: Ambiguity of @{ shift }
by Anonymous Monk on Sep 24, 2004 at 07:13 UTC | |
|
Re: Ambiguity of @{ shift }
by ihb (Deacon) on Sep 24, 2004 at 12:44 UTC | |
|
Re: Ambiguity of @{ shift }
by PerlingTheUK (Hermit) on Sep 24, 2004 at 07:36 UTC |