For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > July 2004 > bytes.pm problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author bytes.pm problem
Sergei Shelukhin

2004-07-18, 3:56 pm

Hi. I have the following problem, I am trying to use XML::DOM and I get the
following

Can't locate bytes.pm in @INC (@INC contains:
/usr/lib/perl5/5.00503/i386-linux
/usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux
/usr/lib/perl5/
site_perl/5.005 .) at /usr/lib/perl5/site_perl/5.005/XML/DOM.pm line 32.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.005/XML/DOM.pm l
ine 32.
BEGIN failed--compilation aborted at parse_opml_blogroll.pl line 5.

I searched for wisdom on the net and found a lot of threads describing the
problem and some suggestions to create bytes.pm for earlier version of Perl.
I stumbled upon the package ExtUtils-MakeMaker-6.21_03, and it had a file
called bytes.pm and promised to be the bearer of version-agnostic bytes.pm.
I installed the package and the error persists.

What do I do now? ;)

Oh yeah, this time I installed packages using the correctm ethod of perl
Makefile.PL ... make ... make install (given all the numerous prereqs and
dependencies to install, I think I will soon start typing those 3 lines in
my nightmare dreams ;) )


Sergei Shelukhin

2004-07-18, 3:56 pm

Np.


Sergei Shelukhin

2004-07-18, 3:56 pm

.....I mean nm... sorry for flooding ;)


Joe Smith

2004-07-18, 8:55 pm

Sergei Shelukhin wrote:

> Can't locate bytes.pm in @INC (@INC contains:
> /usr/lib/perl5/5.00503/i386-linux


The bytes pragma did not come until version 5.6.0; you need to upgrade
your version of perl in order to "use bytes".
-Joe
Sergei Shelukhin

2004-07-19, 3:55 am

> The bytes pragma did not come until version 5.6.0; you need to upgrade
> your version of perl in order to "use bytes".

You can if you install the module I mentioned; what needed to be done in my
case was adding path to bytes.pm to @INC ;)


Joe Smith

2004-07-19, 3:55 am

Sergei Shelukhin wrote:

>
> You can if you install the module I mentioned; what needed to be done in my
> case was adding path to bytes.pm to @INC ;)


That won't help. The real bytes.pm sets an internal flag that tells
perl how to handle characters with the high-order bits set. This only
makes a difference when you've got a version of perl that understands
Unicode.

> ExtUtils-MakeMaker-6.21_03, and it had a file
> called bytes.pm and promised to be the bearer of version-agnostic bytes.pm.
> I installed the package and the error persists.


What you have done is to cure the symptoms and not the underlying problem.

=head1 NAME

ExtUtils::MakeMaker::bytes - Version-agnostic bytes.pm

=head1 SYNOPSIS

use just like bytes.pm

=head1 DESCRIPTION

bytes.pm was introduced with 5.6. This means any code which has 'use
bytes' in it won't even compile on 5.5.X. Since bytes is a lexical
pragma and must be used at compile time we can't simply wrap it in
a BEGIN { eval 'use bytes' } block.

ExtUtils::MakeMaker::bytes is just a very thin wrapper around bytes
which works just like it when bytes.pm exists and everywhere else it
does nothing.

=cut

You need to upgrade your version of perl to have "use bytes;" actually
do anything.
-Joe
Tassilo v. Parseval

2004-07-19, 3:55 am

Also sprach Joe Smith:

> Sergei Shelukhin wrote:
>
>
> That won't help. The real bytes.pm sets an internal flag that tells
> perl how to handle characters with the high-order bits set. This only
> makes a difference when you've got a version of perl that understands
> Unicode.


No, bytes.pm tells perl to treat everything as one-byte character. For
pre-5.6.0 perls this is the default behaviour anyway.

Now, the problem is not whether the byte.pm-portions of the code will
work on 5.005_03 (they will), but rather whether the code not under
byte.pm's control will work. Unicode might be a show-stopper there, but
then again maybe no unicode will be involved in practice.

It should be possible for the OP to copy bytes.pm as is from a recent
Perl into @INC of his old perl. In bytes::AUTOLOAD() the first line
requiring bytes_heavy.pl needs to be removed (or wrapped in an eval).

Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{re
htonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com