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

Re: serious PerlIO trouble :(

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
March 12, 2011 02:09
Subject:
Re: serious PerlIO trouble :(
Message ID:
20110312110936.76f8f854@pc09.procura.nl
On Sat, 12 Mar 2011 09:38:12 +0000, David Leadbeater <dgl@dgl.cx> wrote:

> On 12 Mar 2011, at 09:23, H.Merijn Brand wrote:
> [...]
> > $ perl perlio.pl 1
> > UTF-16:Unrecognised BOM 7061 at /pro/lib/perl5/5.12.2/i686-linux-64int-ld/IO/Handle.pm line 1.
> > Compilation failed in require at perlio.pl line 17.
> > Exit 255
> 
> Presumably because the open pragma isn't applying inside IO::Handle

Should it? Should I file an RT?

> If I add a 3rd case, which rather evilly just takes the code from
> IO::Handle, but therefore means it is within the pragma's scope:
> 
>     if ($t == 2) {
>        { no warnings 'once';
>            *IO::Handle::getline = sub {
>                my $this = shift;
>                return scalar <$this>;
>            };
>        }
> 
>        while (my $r = *ARGV->getline) {
>            print $r;
>        }
>        exit 0;
>     }
> 
> Then it works.

-- 
H.Merijn Brand  http://tux.nl      Perl Monger  http://amsterdam.pm.org/
using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00,
11.11, 11.23 and 11.31, OpenSuSE 10.1, 11.0 .. 11.3 and AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About