Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: A Question on a homebrew XML parser

by wog (Curate)
on Jan 23, 2002 at 06:22 UTC ( #140788=note: print w/replies, xml ) Need Help??

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.)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://140788]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2017-07-22 03:46 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (336 votes). Check out past polls.