RE: Hash of arrays

2003-04-03 Thread Joseph P. Discenza
Daniel Gross wrote, on Thursday, April 03, 2003 08:45 : > push @{$dirHash{$prefix}}, $item; : Seems to work. It doesn't generate a syntax error. So, value elements : within a hash are always references? : : BTW, in your opinion would this also work when $dirHash{$prefix} is : undefined (i.e.

Re: Hash of arrays

2003-04-03 Thread Alan Dickey
Daniel Gross wrote: > Seems to work. It doesn't generate a syntax error. So, value elements > within a hash are always references? no, but they are always scalars :) > BTW, in your opinion would this also work when $dirHash{$prefix} is > undefined (i.e. when no key was defined yet?) perl has a

RE: Hash of arrays

2003-04-03 Thread Daniel Gross
eph P. Discenza [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 8:36 AM To: Daniel Gross; [EMAIL PROTECTED] Subject: RE: Hash of arrays 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 foll

Re: Hash of arrays

2003-04-03 Thread Thomas R Wyant_III
"Daniel Gross" <[EMAIL PROTECTED]> writes: > 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); >

RE: Hash of arrays

2003-04-03 Thread Joseph P. Discenza
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

Hash of arrays

2003-04-03 Thread Daniel Gross
Hello all, 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; } Thanks Dan

creating array reference to one array of a hash of arrays

2002-07-12 Thread Jares, Howard M
# I have a program that gets a hash from an API call. # the format of the hash is that each key corresponds to an # array. The following code snippet illustrates the data: $href->{One} = [1,2,3,4]; print ref($href)."\n"; print ref($href->{One})."\n"; # I would like to simplify the syntax to use a

Re: hash of arrays

2002-01-16 Thread dolljunkie
- Original Message - From: "Peter Eisengrein" <[EMAIL PROTECTED]> > That just adds a field to my output, like so: > > 7943641|ARRAY(0x1b9efb8)|| > > > Perhaps I'm contructing it wrong? I'm doing it like this... > > @_=$features{$dn}; > push(@_,$line[1]); > $features{$dn}=\@_; >

RE: hash of arrays

2002-01-16 Thread Peter Eisengrein
BINGO! Thanks Rob. > -Original Message- > From: Hanson, Robert [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 16, 2002 10:58 > To: 'Peter Eisengrein' > Subject: RE: hash of arrays > > > Hmmm... > > If $features{$dn} is a reference to

RE: hash of arrays

2002-01-16 Thread Peter Eisengrein
OTECTED]] > Sent: Wednesday, January 16, 2002 10:43 > To: 'Peter Eisengrein'; Perl-Win32-Users Mailing List (E-mail) > Subject: RE: hash of arrays > > > > This is what you want... > > foreach my $dn (keys %features) > { > my @features = @{$features