Perl noob, coming in from Python and Bash. Reading the llama book, in the bit about arrays, and noted something...unexpected.
@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";
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