develooper Front page | perl.beginners | Postings from March 2002

Re: Data::Dumper documentation ?

Thread Previous
From:
maasha
Date:
March 19, 2002 05:47
Subject:
Re: Data::Dumper documentation ?
Message ID:
20020319134641.GG1274@image
this works nicely:


use Data::Dumper;

my ( $hash_ref, $new_hash );

my $hash_file = 'test.hash';

{  #block to control scope
  local ($/) = undef; #make this change local so as not to screw up anything else

  open SOURCE, $hash_file or die "Can't open file: $!";
  $hash_ref = eval <SOURCE>;
  die $@ if $@;
  close SOURCE;
}

print Dumper($hash_ref);

eval Data::Dumper->Dump([$hash_ref], [qw(new_hash)]);

print "$new_hash->{key_name}\n"; #prints the cognate value of key_name from the hash

im gonna forward some of this stuff to the maintainer of perldoc Data::Dumper!

thanks!

:o)

martin

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About