in reply to How to access contents of a reference to a hash.

The way you initialize the hash is wrong. Add use warnings; use diagnostics; to the top of your script to see why.

Replies are listed 'Best First'.
Re^2: How to access contents of a reference to a hash.
by opensourcer (Monk) on Jan 31, 2005 at 12:47 UTC
    thanks a lot it's really helpfull
    perl -> 'hacker"' hello -> 'world,' says -> '=>' "just -> 'another'
    but i want some thing like this
    hello -> 'world,' says ->just another perl hacker
      i got it
      #!/usr/bin/perl use warnings; use diagnostics; my %hash = ('hello' => 'world', 'says' => 'just another perl hacker'); my $hashref = \%hash; foreach my $k (keys %$hashref) { print "$k -> '$hashref->{$k}'\n " }
      Thanks a lot guys
        monks don't -- me Re^2 is me who wrote Re^3