You can use a slice to get the proper effect:
That'll provide list context to the inner expression, and then extract just the 0'th element from that.my $bar=($twig->get_xpath($my_xpath))[0]->text;
-- Randal L. Schwartz, Perl hacker
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
In reply to Re: XML::Twig - trying to simplify syntax
by merlyn
in thread XML::Twig - trying to simplify syntax
by smiffy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |