http://www.perlmonks.org?node_id=140788


in reply to A Question on a homebrew XML parser

The loop is exiting because of your test:

CHAR: while($currSymbol = getc($fh)) {
The character 0 is false, and thus fails this test. You probably should use something like:
CHAR: while( defined($currSymbol = getc($fh)) ) {

(If you were using <$fh> to read from the file this would not be a problem even if you read 0 only because perl special cases that to have an implict defined() around it.)