develooper Front page | perl.perl5.porters | Postings from March 2000

RE: Source filters

Thread Previous | Thread Next
Moore, Paul
March 24, 2000 07:32
RE: Source filters
Message ID:
From: Gurusamy Sarathy []
> It needs a more complete patch than that.  See below.

Oooh. I'd never have got that...

> >introduced, for byteloader). Maybe the filter module needs 
> >something in the API to request binmode or textmode input
> >of the script (with textmode the default, as I expect the
> >majority of filters will be text-based).
> I disagree.  See ByteLoader.  It would be the job of the 
> particular filter implementation to know whether it wants
> to filter "text" or "binary" input, and behave accordingly.
> I think Filter::Util::Call could use some convenience switches
> to do s/\r$// in filter_read() or ignore CRs when counting characters
> in filter_read_exact().  But I don't think it's really that big a
> portability issue if it can be clearly documented.

That's sort of what I was thinking of. But there will of necessity be a
default if the filter doesn't specify anything explicit. I would say that
should be textmode, (a) for backward compatibility, and (b) because I would
expect many of the uses of filters (particularly by the non-experts who
wouldn't necessarily have found out about a binary input switch) would be
straight text-handling.

Thanks for the patch in any case.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About