in reply to Re: Precendence and wantarray puzzling me
in thread Precendence and wantarray puzzling me
When I first saw that, I thought to myself "Couldn't that unless @thingies modifer be replaced by an ||=?" So I tried it, perl -e"@x=qw/foo bar/; @x ||= qw/baz/; print @x" And got this lovely error: Can't modify array dereference in logical or assignment (||=) at -e line 1, near "qw/baz/;". Can anyone explain why ||= doesn't work with an array, and what that error means?my @thingies = foo (); @thingies = bar () unless @thingies;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Precendence and wantarray puzzling me
by Abigail-II (Bishop) on Mar 04, 2004 at 21:27 UTC |