i accidentally hit the new button a little too early, sorry for the duplicate posts...
i have a subroutine which does some processing on html files and stores values from those files into a hash. now up until recently i had made it a habit not to use -w or use strict in my scripts, but well i just decided i oughta start :) so anyway, i have this hash that looks like this:
sub processhtml {
my ($file) = $_[0];
my ($filename, $i, $value2, $value3);
my (@input, @values);
... substitution and pattern match stuff ...
@values = split(" ", $i);
if ($values[2] !~ /^[a-z]{1,2}$/i) {
$values[2] = "";
} else {
}
if ($values[0] !~ /000/) {
$import_values{"ship"} = $file;
$import_values{"weight"} = $values[0];
$import_values{"dwg"} = $values[1];
$import_values{"rev"} = $values[2];
foreach $value2 (keys %import_values{"ship","weight","dwg","rev
+"}) {
print TEMP ("\"$value2\",");
}
print TEMP ("\n");
} else {
$import_values{"ship"} = $file;
$import_values{"weight"} = "";
$import_values{"dwg"} = $values[1];
$import_values{"rev"} = $values[2];
foreach $value3 (keys %import_values{"ship","weight","dwg","rev
+"}) {
print TEMP ("\"$value3\",");
}
print TEMP ("\n");
}
}
now the problem lies in the foreach loops, i keep getting the error "Can't use subscript on private hash" and i don't know why... as weird as it may sound prior to applying use strict and -w i had array symbols preceding them
foreach $value3 (keys @import_values{"ship","weight","dwg","rev
+"}) {
print TEMP ("\"$value3\",");
}
and it worked, but now this problem is driving me up the wall... can anyone shed any light on this for me?