I'm trying to do those time honored exercises from the llama book and having
some trouble.
This is the subroutine I'm using:
sub init_words {
while ($filename = <*.secret>) {
open (WORDSLIST, $filename) || die "can't open $filename: $!";
if (-M WORDSLIST < 7.0) {
while ($name = <WORDSLIST>) {
chomp ($name);
$word = <WORDSLIST>;
chomp ($word);
$words{$name} = $word;
}
} else {
rename ($filename, "$filename.old") || die "can't rename $filename:
$!";
}
close WORDSLIST;
}
}
I don't get any error messages, but neither do I get the variables that I
need for the program to execute properly. Any help would be appreciated.