I think the return value is the list contains 3 numbers, and when in the scalar context, the $value should be 3. However, the return value is the last element of the list. Even I used the conserved word 'scalar' before the function find_chores(), the returned value was still 310, not 3 as the expected. This is confusing me. Do I miss something here?use Modern::Perl; use autodie; sub find_chores { return (8,456,310); } my $value = find_chores(); say $value;
In reply to why the output is not my expected? by zhenyisong
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |