The code is below; what's pertinent is really the last line.
When I drop the ."\n" the hash prints as expected, but with no line breaks
between records. Assuming concactenating the \n would do it, I threw it into
the print command.
Now it returns a value of 2/8 instead of the hash values. . . what's the
deal here?
[code snipped]
while (<CUSTSPEC>){
chomp;
/(.*?),/; #pattern matching. Grabs everything up to the first comma.
(The material number)
$key = $1;
/.*?,(.*)/;
#print 'First:'. $1."\n"; # sanity check 1
#print 'Key:'.$key."\n"; # sanity check 2
$cs{$key} = $1; #create
;
}
print $cs{"DRESXYQB"}."\n\n";
print %cs."\n";