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

Re: PerlIO - what next ?

Thread Previous | Thread Next
Benjamin Stuhl
November 8, 2000 10:46
Re: PerlIO - what next ?
Message ID:
--- Nick Ing-Simmons <> wrote:
> Now that perlio is in the mainline I _really_ need to
> know 
> what to do next in terms of making it useful.
> This means knowing what it "should" look like to perl5:
> Do you want getc($fh) return character or a byte
> depending on the handle's 
> top "layer" ?

Yes, taking into account what the top layer gor from
> Likewise does 
>    $count = read($fh,$buffer,10); 
> read 10 chars or 10 bytes depending on mode ? 


> How do you want I open a file which is utf8 or shift-jis
> or whatever?

open my $fh, "< :shift-jis JapaneseTextFile" or die $!;

> What should "binmode" mean now we have layers?

binmode $fh, "+:utf8"; # means "push the :utf8 layer"

How should one remove layers?
'binmode $fh, "-"' anyone?

-- BKS

P.S. PerlIO really has enough separate components it might
be worth putting it into its own subdirectory. It also
might be worth making perlio.h not just be '#include
"iperlsys.h"'. I'm starting to look at porting PerlIO to
Win32 and it would be much easier if each layer was its own
source file (keeps me from having to create an #ifdef WIN32 morass).

Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one Place.

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