my closest guess is that what is in CAPS is to be the key and what follows is to be pushed on to the array of the hash value. suppose you input below is in file.txt:
__CODE__ use strict; use warnings; open(FILE, "<file.txt") or die "cannot open: $!"; my(%DATA, $key); while(<FILE>){ chomp; if(/^[A-Z0-9]+$/){ $key = $_; } else { push @{$DATA{$key}}, $_; } } close FILE; __END__ now %DATA contains keys which are the CAP_ENTRIES and that references an array that contains all the lowercase_entries below until the next CAPS_ENTRY. > -----Original Message----- > From: Coppi Nikula [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 02, 2002 9:25 AM > To: [EMAIL PROTECTED] > Subject: I need help writing a hash of an array > > > > I need to write a script that is reading line by line > through a file and put it into a hash of an array that looks > like this: > > > > This is just an example, so it looks like garbage. This is > what I need to capture in memory and also if I was to print > it, it needs to look like this in a list. My list will > always be different so I don't want to set it up manually, > the script needs to set it up and I'm completely confused. > Any help will be greatly appreciated. > > > > AI2000 (this is to be the HASH) > > awblib (These are to be the arrays) > > awplib > > cdslic > > poiejs > > josiudf > > asdjfi > > sodifs > > sdlfjsoif > > AV3200 (this is to be the HASH) > > iosdfh > > sdfa;skh > > akdfhsk > > askdhfsk > > asdkfhsk > > akdshfs > > askdhfask > > PX4000 > > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]