S
sc_wizard29
Hi everyone,
This is a basic beginner's questions concerning the 'print' function :
my @array = 1..3;
print @array , "\n"; # prints : 123
print @array . "\n," # prints : 3 (the array size)
I was surprised to see that the second 'print' call prints the array
size... my guess is that at one particular moment, @array is evaluated
in a scalar context which gives the array size, but I don't see exactly
where and why this evaluation is done.
Can someone give me a few hints on this ?
Thanks for helping...
This is a basic beginner's questions concerning the 'print' function :
my @array = 1..3;
print @array , "\n"; # prints : 123
print @array . "\n," # prints : 3 (the array size)
I was surprised to see that the second 'print' call prints the array
size... my guess is that at one particular moment, @array is evaluated
in a scalar context which gives the array size, but I don't see exactly
where and why this evaluation is done.
Can someone give me a few hints on this ?
Thanks for helping...