in reply to Some issues with WWW::Mechanize::Firefox->xpath() method

Even:
@ret = $mech->xpath('substring("hello",1,4)', { single => 1 } )
Returns an empty array. It may be that you simply have to return the full text node to perl and then perform the substring in perl code.