Re: hash array

2006-02-15 Thread anand kumar
; my $age = $1 if ($_ = <>) =~ /AGE\s+(.*)$/; my $book = $1 if ($_ = <>) =~ /Book\s+(.*)$/; $hash{$name}->{age} = $age; $hash{$name}->{book} = $book; } } # then print the value -Original Message- From: anand kumar Sent: Feb 15, 2006 10:33 PM To: beginners@perl.org Su

Re: hash array

2006-02-15 Thread Jeff Pang
= <>) =~ /Book\s+(.*)$/; $hash{$name}->{age} = $age; $hash{$name}->{book} = $book; } } # then print the value -Original Message- From: anand kumar <[EMAIL PROTECTED]> Sent: Feb 15, 2006 10:33 PM To: beginners@perl.org Subject: Re: hash array Hi ,

Re: hash array

2006-02-15 Thread Tom Phoenix
On 2/15/06, anand kumar <[EMAIL PROTECTED]> wrote: > can anyone help me on how to store the data with hash key as the 'Name' > and the hash strings as the details of 'AGE' and 'Book' Perl's hashes use a single key to look up a single value. So, to keep this simple, you can use two hashes, %age

Re: hash array

2006-02-15 Thread anand kumar
Hi , Thanks for the reply. but can u help me out if the data is large and need a loop to store(also if possible give instructions if the record has variable or optional number of fields). Jeff Pang <[EMAIL PROTECTED]> wrote: Name ABC AGE 25 Book perl Name DEF AGE 20 Book linux Name GHI

Re: hash array

2006-02-15 Thread Jeff Pang
Name ABC AGE 25 Book perl Name DEF AGE 20 Book linux Name GHI AGE 21 Book PHP . can anyone help me on how to store the data with hash key as the 'Name' and the hash strings as the details of 'AGE' and 'Book' Hello,I think you could do it as followin

Re: hash array of arrays?

2001-07-29 Thread Jos I. Boumans
just dereference it: foo( @{ $R{"first"} } ); it's as easy as that =) hth Jos Boumans > > Hi all, > > here's my question :): > > I define a hash array: > our %R=("first" => [ "one", "two" ], "second" => ["third", "fourth"]); > > Now I can get back back array references from this using: