Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Perl / September 2007



Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Macosx Perl Org - 15 Sep 2007 13:44 GMT
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 (@INC contains: /sw/lib/perl5 /sw/lib/perl5/darwin /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1 .) at ./tst.pl line 3.

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.

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

Anyone seen this behaviour?
What to do about it?

Thanks
Bernhard

Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
 Platform:
   osname=darwin, osvers=8.0, archname=darwin-thread-multi-2level
   uname='darwin b19.apple.com 8.0 darwin kernel version 8.3.0: mon oct 3 20:04:04 pdt 2005; root:xnu-792.6.22.obj~2release_ppc power macintosh powerpc '
   config_args='-ds -e -Dprefix=/usr -Dccflags=-g  -pipe  -Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib'
   hint=recommended, useposix=true, d_sigaction=define
   usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
   useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
   use64bitint=undef use64bitall=undef uselongdouble=undef
   usemymalloc=n, bincompat5005=undef
 Compiler:
   cc='cc', ccflags ='-g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include',
   optimize='-O3',
   cppflags='-no-cpp-precomp -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include'
   ccversion='', gccversion='4.0.1 (Apple Computer, Inc. build 5363)', gccosandvers=''
   intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
   d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
   ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
   alignbytes=8, prototype=define
 Linker and Libraries:
   ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-L/usr/local/lib'
   libpth=/usr/local/lib /usr/lib
   libs=-ldbm -ldl -lm -lc
   perllibs=-ldl -lm -lc
   libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib
   gnulibc_version=''
 Dynamic Linking:
   dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
   cccdlflags=' ', lddlflags='-bundle -undefined dynamic_lookup -L/usr/local/lib'

Characteristics of this binary (from libperl):
 Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
 Locally applied patches:
       23953 - fix for File::Path::rmtree CAN-2004-0452 security issue
       33990 - fix for setuid perl security issues
       SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
 Built under darwin
 Compiled at Nov  1 2006 17:07:31
 %ENV:
   PERL5LIB="/sw/lib/perl5:/sw/lib/perl5/darwin"
 @INC:
   /sw/lib/perl5
   /sw/lib/perl5/darwin
   /System/Library/Perl/5.8.6/darwin-thread-multi-2level
   /System/Library/Perl/5.8.6
   /Library/Perl/5.8.6/darwin-thread-multi-2level
   /Library/Perl/5.8.6
   /Library/Perl
   /Network/Library/Perl/5.8.6/darwin-thread-multi-2level
   /Network/Library/Perl/5.8.6
   /Network/Library/Perl
   /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level
   /System/Library/Perl/Extras/5.8.6
   /Library/Perl/5.8.1
   .
David Cantrell - 17 Sep 2007 17:14 GMT
> If I run this script:
> #!/usr/bin/perl
[quoted text clipped - 10 lines]
> 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.

Signature

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?"

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.