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
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]
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