Daniel Gross wrote, on Thursday, April 03, 2003 08:34
: I running into problems again: This time I'd like to fill a hash with
: arrays, however, the following push command generates a syntax error.
: Any idea why
: 
: My %dirHash = ();
: 
: foreach my $item(@dirArray) {
:     $prefix = substr($item, 0,4);
:     push @dirHash{$prefix}, $item;
: }

Try this (untested):

        push @{$dirHash{$prefix}}, $item;

Remember, it's a hash of array *references*; you have to de-reference
the scalar that's in the hash in order to act on it as an array.

Joe

==============================================================
          Joseph P. Discenza, Sr. Programmer/Analyst
               mailto:[EMAIL PROTECTED]
 
          Carleton Inc.   http://www.carletoninc.com
          574.243.6040 ext. 300    fax: 574.243.6060
 
Providing Financial Solutions and Compliance for over 30 Years
***** Please note that our Area Code has changed to 574! ***** 

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to