mystik has asked for the wisdom of the Perl Monks concerning the following question:
I want to do something like this:
but perl doesn't let me:sub foo { return ({},[]); } my (%baz, @bar); (\%baz,\@bar) = &foo();
Is there a one liner to assign references into named non-reference vars?Can't modify reference constructor in list assignment at foo.pl line 5 +, near ");" Execution of foo.pl aborted due to compilation errors.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Assign a reference to a non reference
by fglock (Vicar) on Oct 03, 2002 at 11:36 UTC | |
by Anonymous Monk on Oct 03, 2002 at 13:30 UTC | |
by grinder (Bishop) on Oct 03, 2002 at 14:02 UTC | |
|
Re: Assign a reference to a non reference
by merlyn (Sage) on Oct 03, 2002 at 14:36 UTC | |
|
Re: Assign a reference to a non reference
by antifun (Sexton) on Oct 03, 2002 at 14:08 UTC |