Re: reading a text file - correction

2001-07-25 Thread acavallari
Sorry... let me correect my previous mail. Try this: open(STATES,"state.txt")||die "can't open file"; while () { ($myval, $mykey) = split /[:\s]+/, $_; # Corrected this line from my previous mail :-) $myhash{$mykey} .= $myval.', '; } close STATES; # Let's write the output foreach $loopkey

Recall: Re: reading a text file

2001-07-25 Thread acavallari
acavallari would like to recall the message, "Re: reading a text file". -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: reading a text file

2001-07-25 Thread acavallari
Why don't you try this: open(STATES,"state.txt")||die "can't open file"; while () { ($mykey, $myval) = split /\s+/, $_; $myhash{$mykey} .= $myval.', '; } close STATES; # Let's write the output foreach $loopkey (keys %myhash) { $myhash{$loopkey }=~s/,\s$//; # Remove last comma and space