fgg1991 has asked for the wisdom of the Perl Monks concerning the following question:
I understand that in this situation $r woulb be a ref and print $r would give me sth like ARRAY(0x35423542), but I don't understant the second example, why it would give me bbb, the last element ?my $r = ['111','222','aaa','bbb']; print $r; my $s = ('111','222','aaa','bbb'); print $s;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The behavior when assigning an array to scalar?
by choroba (Cardinal) on Sep 26, 2017 at 09:52 UTC | |
|
Re: The behavior when assigning an array to scalar? (updated)
by haukex (Archbishop) on Sep 26, 2017 at 09:56 UTC | |
|
Re: The behavior when assigning an array to scalar?
by perl-diddler (Chaplain) on Sep 27, 2017 at 05:55 UTC | |
by haukex (Archbishop) on Sep 27, 2017 at 08:10 UTC | |
by perl-diddler (Chaplain) on Sep 27, 2017 at 14:59 UTC | |
by choroba (Cardinal) on Sep 27, 2017 at 20:29 UTC |