It appears that your string is an output from Data::Dumper
perhaps? No matter the source, it can be turned into a data structure using an eval
.
Then it's just a matter of a bit of decyphering of the RPC::XML
documentation to come up with the following:
use strict;
use warnings;
use RPC::XML;
my $str = do { local $/; <DATA> };
my $req = do {
no strict 'vars';
eval $str;
} or die "Error in data, $@";
### You should already have a $req equivalent object.
my $hashref = ${$req->args}[0]->value;
while (my ($k, $v) = each %$hashref) {
print "$k -> $v\n";
}
__DATA__
$VAR1 = bless( {
'args' => [
bless( {
'SEQUENCE' => bless( do{\(my $o = '0')}, 'RPC::XML::string' ),
'LANGUAGE' => bless( do{\(my $o = 'FRA')}, 'RPC::XML::string' ),
'END_OF_SESSION' => bless( do{\(my $o = 'FALSE')}, 'RPC::XML::string' ),
}, 'RPC::XML::struct' )
],
'name' => 'get.getMethod'
}, 'RPC::XML::request' );
Outputs:
SEQUENCE -> 0
LANGUAGE -> FRA
END_OF_SESSION -> FALSE