This seems to be a filehandle issue. I am using IO::File to access 5 static HTML files, in order to build a web page. I have used this technique before with one file, but something goes wrong when I reuse the variable holding the filehandle. Everything executes fine, but I get errors during cleanup.
Here is a code fragment:
use IO::File (); local $/; foreach (sort keys %altnames) { my $fh = IO::File->new; my ($hr_title) = m/(.*)\.txt/; print("<hr> <h1 align=center> $hr_title </h1>\n"); my $source = join '/', $dir, $_; $fh->open($source); while (<$fh>) { print($_); } $fh->close; }
I have found that I get the error even for one loop. I inserted "last;" just after the close to test.
If I comment the print($_) statement, I still get the error.
If I comment the "while (<$fh>)" loop entirely, the errors go away!!
Here is the error log:
Unbalanced string table refcount: (1) for "Oracle.txt" during global destruction. Unbalanced string table refcount: (1) for "Administration.txt" during global destruction. Unbalanced string table refcount: (1) for "Perl.txt" during global destruction. Unbalanced string table refcount: (1) for "Java.txt" during global destruction. Unbalanced string table refcount: (1) for "Web Development.txt" during global destruction.Thanks for any help!
Edited 2003-03-19 by mirod: replaced pre tags by code tags
In reply to Unbalance string table refcount by Lhamo Latso
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |