in reply to Re: Sorting the hash
in thread Sorting the hash

Thank you for giving answer. But i'm getting the following err. Global symbol "$x" requires explicit package name at D:\Perl\quote_1.pl line 24

Replies are listed 'Best First'.
Re^3: Sorting the hash
by Utilitarian (Vicar) on Oct 04, 2010 at 11:02 UTC
    Which is why we use strict, the line should read
    print Dumper(\%x);
    And by using stricture the error was highlighted rather than causing you to puzzle out why there was no returned values.

    print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
Re^3: Sorting the hash
by eyepopslikeamosquito (Archbishop) on Oct 04, 2010 at 11:03 UTC
Re^3: Sorting the hash
by halfcountplus (Hermit) on Oct 04, 2010 at 11:06 UTC

    That line should be:

    print Dumper(\%x);

    Instead of:

    print Dumper($x);

    Since you could have a hash, %x, and a completely unrelated scalar, $x, in the same scope.

Re^3: Sorting the hash
by annem_jyothsna (Initiate) on Oct 04, 2010 at 11:12 UTC
    Thanks dasgar.. Now i got it Thank you so much