I am a newbie in Perl. I'm trying to understand Perl context. I've the following Perl code.
use strict;
use warnings;
use diagnostics;
my @even = [ 0, 2, 4, 6, 8 ];
my @odd = [ 1, 3, 5, 7, 9 ];
my $even1 = @even;
print "$even1\n";
When I execute the code, I get the following output ...
1
But, as I've read, the following scalar context should places the number of elements in the array in the scalar variable.
my $even1 = @even;
So, this is bizarre to me. And, what's going inside the code?