in reply to assigning hash key to reference of array question

Change:
$HoA{ join('_',$swit,$server) } = \@ip_g;
to:
push @{ $HoA{ join('_',$swit,$server) } }, @ip_g;

Update: see my disclaimer... Re^5: assigning hash key to reference of array question

Replies are listed 'Best First'.
Re^2: assigning hash key to reference of array question
by Anonymous Monk on Feb 28, 2011 at 20:25 UTC
    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.
      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!!!!