XML::SAX::PurePerl

Matts on 2001-10-25T20:16:25

Today I realised that after my laptop died, I had lost the sources to XML::SAX::PurePerl, because I had never checked it into my CVS repository (which is backed up every night). Thank god for CPAN eh?

Anyway, I downloaded it and immediately discovered that it doesn't work *at all* on perl 5.00503. Mostly because of some wierd issues:

  • binmode($fh, ':raw') for some reason this caused: Useless use of private variable in void context, at compile time. I got around that by sticking it in an eval"" block. I'm sure there's a better way, but I was being lazy.

  • unpack('U*') of course doesn't work on non-unicode aware Perls, so I check the perl version and use 'C*' on 5.00503.

  • The different encoding tests of course don't work on perls without PerlIO. So I skip those tests now.
Seems to work, and I'd love some more feedback from people trying it.


binmode

bart on 2001-11-30T13:32:56

>Anyway, I downloaded it and immediately discovered that it doesn't work *at all* on perl 5.00503. Mostly because of some wierd issues:

> binmode($fh, ':raw') for some reason this caused: Useless use of private variable in void context, at compile time. I got around that by sticking it in an eval"" block. I'm sure there's a better way, but I was being lazy.

It also doesn't work.

You should check out the perlfunc entry for binmode(). It says:

DISCIPLINE can be either of ":raw" for binary mode or ":crlf" for "text" mode. If the DISCIPLINE is omitted, it defaults to ":raw".

Just drop the ":raw", will you? The result of putting it in an eval block just makes this fail, so the handle stays in text mode, which is bad.