S
Shripathi Guruprasannaraj
Hi,
The function am trying to write reads strings from a file. The file's
contents are numbers like 00101201. I am inserting them into a hashtable
removing the duplicates. I then write the keys into a file. The output
file contains a HASH(0x1169e4) string but the other keys are written
properly. I guess its actually a reference but I dont know how to
eliminate it. I am giving the code sample below.
foreach $line (@filecontents) {
($key,$value) = split(" ",$line);
if($key =~ m/^$year/) {
if (! defined($nodes{"$key"})) {
$nodes{"$key"} = 1;
}
}
}
@keys = keys %nodes;
foreach(@keys) {
print outputfile "\n$_";
}
Please give me some suggestions and also why its happening.
Thanks,
Raj
The function am trying to write reads strings from a file. The file's
contents are numbers like 00101201. I am inserting them into a hashtable
removing the duplicates. I then write the keys into a file. The output
file contains a HASH(0x1169e4) string but the other keys are written
properly. I guess its actually a reference but I dont know how to
eliminate it. I am giving the code sample below.
foreach $line (@filecontents) {
($key,$value) = split(" ",$line);
if($key =~ m/^$year/) {
if (! defined($nodes{"$key"})) {
$nodes{"$key"} = 1;
}
}
}
@keys = keys %nodes;
foreach(@keys) {
print outputfile "\n$_";
}
Please give me some suggestions and also why its happening.
Thanks,
Raj