in reply to XML::Xpath: How to get string from literal

According to XML::XPath::Literal, objects of that type are overloaded to return a string when needed.

print $status; # Automatically gets converted to a string.

The issue can be forced using interpolation, concatenation or the provided method.

my $status_str1 = "$status"; # Auto converted to a string. my $status_str2 = '' . $status; # Auto converted to a string. my $status_str3 = $status->value();

Replies are listed 'Best First'.
Re^2: XML::Xpath: How to get string from literal
by cormanaz (Deacon) on Jan 19, 2007 at 22:19 UTC
    When I try that it prints nothing and/or $status_str1 is null. I thought to myself: Ok, maybe the object is not parsing, but when I try

    print $nodeset->[1]->string_value;

    I get

    ebd2abff-7c52-49ec-a7f3-7714dd3934ec look_again.blogspot.com/ B00006D9SV 14 Success

    So I'm a little baffled here...