in reply to Re: assigning hash key to reference of array question
in thread assigning hash key to reference of array question

spark@server1 ~> cat -nv ././././t1 | grep 21 21 push @{ $HoA{ join('_',$swit,$server) } } = @ip_g; spark@server1 ~> perl -c ././././t1 Useless use of push with no values at ././././t1 line 21. Type of arg 1 to push must be array (not list assignment) at ././././t +1 line 21, near "@ip_g;" ././././t1 had compilation errors.

Replies are listed 'Best First'.
Re^3: assigning hash key to reference of array question
by toolic (Bishop) on Feb 28, 2011 at 20:30 UTC
    You need to use a comma instead of an = (just like my code shows).
      Yes, thank you that works.. I really need to understand what is going on... thank you all guys!!!!
        Keep in mind that, while my code avoids clobbering keys, it is not a complete solution. Others have provided complete (and better) solutions.