in reply to Re: calling a hash
in thread calling a hash

no sorry not the person who posted earlier. but i have resolved the problem, removing the $ in the hash corrected it Thanks for all of your help

Replies are listed 'Best First'.
Re^3: calling a hash
by blazar (Canon) on Oct 04, 2005 at 13:37 UTC
    Indeed this is a situation in which turning on warnings would have solved the problem for you:
    $ perl -we '%a=($bob => "foo")' Name "main::a" used only once: possible typo at -e line 1. Name "main::bob" used only once: possible typo at -e line 1. Use of uninitialized value in list assignment at -e line 1.
    See in particular the last line. But then if had also turned on strict
    $ perl -Mstrict -e 'my %a=($bob => "foo")' Global symbol "$bob" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors.
    So, to put it briefly: do it!