Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Everytime I try to print below prints as a to decode it?

my $response = $QMIService->GetResponse ($token,60000); print "\nRESPONSE:$response";-->prints RESPONSE:QMIResponse=HAS +H(0xe68d4d4)

Replies are listed 'Best First'.
Re: How to decode a hash value
by sauoq (Abbot) on May 14, 2012 at 00:27 UTC

    You just want to see what's in it?

    use Data::Dumper; print Dumper( $response );

    "My two cents aren't worth a dime.";
Re: How to decode a hash value
by kcott (Archbishop) on May 14, 2012 at 00:45 UTC

    $response is a reference to a hash blessed into the QMIResponse class (I couldn't find this module on CPAN). You can dereference with %$response for the whole hash, @{$response}{@slice_keys} for a hash slice or $response->{$key} for individual values.

    However, before trying to access that data directly, look for methods provided by the QMIResponse class for doing this. Using the methods provided by the class means that $response->get_whatever() still works long after QMIResponse=HASH(0xe68d4d4) becomes QMIResponse=ARRAY(0xe68d4d4) or QMIResponse=SCALAR(0xe68d4d4).

    -- Ken

Re: How to decode a hash value
by AnomalousMonk (Archbishop) on May 14, 2012 at 00:40 UTC
    my $response = $QMIService->GetResponse ($token,60000);

    I have no experience with the QMIResponse module (don't even know where it might be found; it's not on CPAN), but this method call is almost certainly returning an object reference of some kind. Check the QMIResponse (and related module) docs for methods that access object instance data.

Re: How to decode a hash value
by planetscape (Chancellor) on May 14, 2012 at 09:59 UTC

    For future reference, please see References.