And scalar applied to a list returns the number of elements in the list.
That statement could be misleading...:
$num = scalar ( qw(foo bar) ); print $num; # "bar", not 2!
A list (as opposed to an array) in scalar context evaluates to its last element.
In reply to Re^4: print array of hashes
by almut
in thread print array of hashes
by fionbarr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |