On Tue, 2002-03-19 at 04:11, [EMAIL PROTECTED] wrote:
> hi
> 
> i have read the documentation on Data::Dumper from Learning Perl, Perl Cookbook and 
>perldoc. however, im still very confused. im looking for some beginners documentation 
>and examples. can anyone direct me?
> 
> :o)
> 
> martin

perldoc Data::Dumper will get you the full docs, but this should suffice
for simple uses:

given the hash

%hash = (
        this    => 'that',
        hork    => 'up',
        funny   => 'fvbklejrbnvkbe',
        subtree => {
                name    => 'file',
                handler => 'on_file_activate',
        },
        array   => [ qw(this is an array of words) ],
);

You could say

print Dumper(\%hash);

and get

$VAR1 = {
          'subtree' => {
                         'handler' => 'on_file_activate',
                         'name' => 'file'
                       },
          'hork' => 'up',
          'funny' => 'fvbklejrbnvkbe',
          'this' => 'that',
          'array' => [
                       'this',
                       'is',
                       'an',
                       'array',
                       'of',
                       'words'
                     ]
        };

you could also say

print Data::Dumper->Dump([\%hash], [qw(new_hash)]);

and get

$new_hash = {
              'subtree' => {
                             'handler' => 'on_file_activate',
                             'name' => 'file'
                           },
              'hork' => 'up',
              'funny' => 'fvbklejrbnvkbe',
              'this' => 'that',
              'array' => [
                           'this',
                           'is',
                           'an',
                           'array',
                           'of',
                           'words'
                         ]
            };

and even go so far as saying 

eval Data::Dumper->Dump([\%hash], [qw(new_hash)]);
print "$new_hash->{funny}\n";

and get

fvbklejrbnvkbe


-- 
Today is Pungenday the 5th day of Discord in the YOLD 3168
Pzat!
Today is also Mojoday
Missile Address: 33:48:3.521N  84:23:34.786W


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to