rkappler has asked for the wisdom of the Perl Monks concerning the following question:
In the first section I'm getting the contents of the array and in the second the size of the array, seemingly based on how I'm using the newlines. Is this some odd anomaly or intended functionality? Am I missing something? regards, Richard@array = 5..9; # this section works as expected print @array; # 56789 print "\n"; $fred = pop(@array); print $fred; # 9 print "\n"; print @array; # 5678 print "\n"; @new_array = 1..5; # this section does not print @new_array . "\n"; # 5 $barney = pop(@new_array); print $barney . "\n"; # 5 print @new_array . "\n"; # 4 print "\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: arrays and dot operator
by vrk (Chaplain) on Apr 05, 2017 at 14:06 UTC | |
by BillKSmith (Monsignor) on Apr 05, 2017 at 14:59 UTC | |
by vrk (Chaplain) on Apr 06, 2017 at 12:05 UTC | |
Re: arrays and dot operator
by haukex (Archbishop) on Apr 05, 2017 at 14:20 UTC | |
Re: arrays and dot operator
by thanos1983 (Parson) on Apr 05, 2017 at 14:22 UTC | |
Re: arrays and dot operator
by huck (Prior) on Apr 05, 2017 at 14:02 UTC | |
by haukex (Archbishop) on Apr 05, 2017 at 14:27 UTC | |
Re: arrays and dot operator
by rkappler (Initiate) on Apr 05, 2017 at 14:11 UTC | |
Re: arrays and dot operator
by rkappler (Initiate) on Apr 05, 2017 at 14:01 UTC |