Compare:
$\=$/; @a = qw( d e f ); print(@a); # prints 'def' print(scalar(@a)); # prints '3' print(@a==3?'3':'!3'); # prints '3'
print accepts a list as an argument. @array returns a list of its elements in a list context.
< accepts scalars as arguments. @array returns the number of elements it has in a scalar context.
So yes, you can rely on @{$db{$key}} for your test. If you want to make it clear to yourself, use scalar(@{$db{$key}}) instead.
In reply to Re^3: Hash of arrays of arrays
by ikegami
in thread Hash of arrays of arrays
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |