List Info

Thread: BUG: strange behaviour with 'use open IN => ":byte"'




BUG: strange behaviour with 'use open IN => ":byte"'
user name
2007-09-17 11:14:15
On Sat, Sep 15, 2007 at 02:44:27PM +0200,
macosx.perl.orgxmlizer.biz wrote:

> If I run this script:
> #!/usr/bin/perl
> use open IN  => ":byte";
> use constant A => 1;
> 
> on a MacBook Pro (Intel) with perl version 5.8.6 (the
pre-installed) I
> get this error:
>   Can't locate constant.pm in INC  ...
> 
> if I change the line to:
> use open IN  => ":encoding(UTF16-BE)";
> 
> I get this error:
>   Unrecognized character xE0 at
/System/Library/Perl/5.8.6/constant.pm line 1.

I get similar with 5.8.7 and 5.9.5 on NetBSD/Alpha, and
5.10.0 patch 31863
on Solaris/SPARC.  Congratulations, it looks like you've
found a bug in
perl!

> In both cases:
> If I swap the lines, everything runs smoothly.

Same here. I've CCed p5p on this mail.

-- 
David Cantrell | A machine for turning tea into grumpiness

    "There's a hole in my bucket, dear Liza, dear
Liza."
    "WHAT MAKES YOU SAY THERE IS A HOLE IN YOUR
BUCKET?"

Re: BUG: strange behaviour with 'use open IN => ":byte"'
user name
2007-09-17 11:26:47
On 17/09/2007, David Cantrell <davidcantrell.org.uk> wrote:
> On Sat, Sep 15, 2007 at 02:44:27PM +0200,
macosx.perl.orgxmlizer.biz wrote:
>
> > If I run this script:
> > #!/usr/bin/perl
> > use open IN  => ":byte";

If you use open IN => ":bytes", that works.

What happens is that perl tries to load PerlIO::byte, in
order to read
constant.pm. But this PerlIO layer isn't found, hence the
(suboptimal
and buggy) error message.

> > use constant A => 1;
> >
> > on a MacBook Pro (Intel) with perl version 5.8.6
(the pre-installed) I
> > get this error:
> >   Can't locate constant.pm in INC  ...
> >
> > if I change the line to:
> > use open IN  =>
":encoding(UTF16-BE)";
> >
> > I get this error:
> >   Unrecognized character xE0 at
/System/Library/Perl/5.8.6/constant.pm line 1.
>
> I get similar with 5.8.7 and 5.9.5 on NetBSD/Alpha, and
5.10.0 patch 31863
> on Solaris/SPARC.  Congratulations, it looks like
you've found a bug in
> perl!
>
> > In both cases:
> > If I swap the lines, everything runs smoothly.
>
> Same here. I've CCed p5p on this mail.
>
> --
> David Cantrell | A machine for turning tea into
grumpiness
>
>     "There's a hole in my bucket, dear Liza, dear
Liza."
>     "WHAT MAKES YOU SAY THERE IS A HOLE IN YOUR
BUCKET?"
>

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )