When I have a function that returns a list in list context and something else in scalar context, and I only want the first element, I use the following:
my ($field) = $mech->xpath( '//div' );
In reply to Re: scenarios to force list context
by Corion
in thread scenarios to force list context
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |