Subject: | Filename with initial space as argument to parse_file() won't read file contents |
A simple code like this doesn't work:
$tree->parse_file( ' abc/def.html' );
Notice the initial space in the filename.
This is because of a 2-arg open in sub parse_file in Parser.pm.
open(F, $file) || return undef;
should be changed to:
open(F, "<", $file) || return undef;
Manually opening the file with a 3-arg open and using the filehandle
instead of the filename as parameter to parse_file() works.