Reading Data::Dumper output

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm trying to use Data::Dumper to determine how to read a structure
and determine how to unpack it.  I'm seeing entries for INTYPE with
values of 8 or 9.  Where would I find what a type 8 or 9 is and
generally how to interpret the output?

I'm running perl v5.8.8 build 822

'TYPE' => {
         'DECIMALS' => 0,
         'NAME' => 'TYPE',
         'POSITION' => 1,
         'OFFSET' => 0,
         'INTYPE' => 9,
         'LEN' => 2,
         'EXID' => 's'
'LOAD1_AVG' => {
         'DECIMALS' => 0,
         'NAME' => 'LOAD1_AVG',
         'POSITION' => 5,
         'OFFSET' => 12,
         'INTYPE' => 8,
         'LEN' => 4,
         'EXID' => 'I'
'NBR_CPU' => {
         'DECIMALS' => 0,
         'NAME' => 'NBR_CPU',
         'POSITION' => 4,
         'OFFSET' => 8,
         'INTYPE' => 8,
         'LEN' => 4,
         'EXID' => 'I'


Re: Reading Data::Dumper output

RB wrote:
Quoted text here. Click to load it
Quoted text here. Click to load it
That would depend on the application that created the data structure. It
has nothing to do with Data::Dumper per se. The documentation for
Data::Dumper would probably be a good start, though.


Re: Reading Data::Dumper output

In article

Quoted text here. Click to load it

[ rest snipped]

Perl structures like the above are actually a hash of hashes. You don't
show how you built your hash or the code that prints it, but it looks
like you have a hash with 3 elements. The values are references to 3
more hashes, each with 7 elements.

The => is a 'fat comma' that indicates a key/value pair as part of a
hash. The { indicates a reference to an anonymous hash with its own
key/value pairs. A [ character would indicate a reference to an array.

You can access the values like this:

  print $hash->;


  print $hash;

which would print the output TYPE.

See 'perldoc perldata' for more details on Perl data structures.

If you need any more help, please post a short program that
demonstrates your problem.


Jim Gibson

 Posted Via Premium Usenet Newsgroup Services

Site Timeline