Hi all,
please have a look at the following code sample:
#!/usr/bin/perl use strict; use warnings; use 5.010; sub get_a_list { return qw(first mid last); } sub get_an_array { my @a = qw(first mid last); return @a; } my $a = get_a_list(); say "\$a: $a"; my $b = get_an_array(); say "\$b: $b";
While the behaviour of case 'b' is clear to me, I can't find an explanation for case 'a'. Can someone give me that explanation or a pointer to documentation explaining it? Why do I get the last element of the list and not the first. And why do I get the element count in case 'b' but not in case 'a'?
Thank you in advance.
Best regards
McA
In reply to Need explanatiin for subtle difference by McA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |