Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

from 5.8 to 5.10

by frasco (Beadle)
on Nov 08, 2008 at 11:43 UTC ( [id://722382]=perlquestion: print w/replies, xml ) Need Help??

frasco has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, I have some cgi-scripts that do their job on a system with perl 5.8 (Ubuntu 8.04). Now I passed these scripts to a PC with perl 5.10 (Ubuntu 8.10) and they don't want to work at all.

By debugging these scripts it appears: "Can't locate B/Bytecode.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 ...etc.)"

One of the main problems seems to me this small pragma section:

use FindBin qw($Bin); use lib "$Bin/lib"; use WebDB;

If I comment the package I created "use WebDB", the script works (more or less) but, since it manage the entire database connection, my program doesn't work properly.

It is possible that it depends on some new features of 5.10?

Thank you in advance, Francesco

Replies are listed 'Best First'.
Re: from 5.8 to 5.10
by clinton (Priest) on Nov 08, 2008 at 11:56 UTC
    You don't provide details of what the WebDB module is, but from perldelta you can see that the B::Bytecode module was removed from perl 5.10.

    clint

      ... you are right Clinton. WebDB is a simple package I created to manage the database connection. It's a simple script with several subroutines to control the DB connection and to menage the HTML output.

      But above all I don't understand what Bytecode is. This is my whole pragma section:

      #!/usr/bin/perl -w use strict; use warnings; use FindBin qw($Bin); use lib "$Bin/lib"; use WebDB; use CGI qw(:standard :html3); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use utf8; binmode(STDOUT, ':utf8');

      As far I understand I don't make use of something named as Bytecode

        Can you show what stuff do you load in WebDB?

        The problem seems to be that it -or something it relies wants to use it.

Re: from 5.8 to 5.10
by ig (Vicar) on Nov 08, 2008 at 18:19 UTC

    The Can't locate error message usually ends with the name of the script and the line number where the error occured, as in the following example. Do you get this in your error message?

    $ ./test.pl Can't locate Uninstalled/Module.pm in @INC (@INC contains: ... /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) a +t ./test.pl line 3. BEGIN failed--compilation aborted at ./test.pl line 3.

      ... it says:

      Can't locate B/Bytecode.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 1) line 18.

      but as i read from the above mentioned "perldelta" (thanks clinton), Bytecode is no longer distributed with the perl sources.

Re: from 5.8 to 5.10
by Pr0t0n (Novice) on May 29, 2009 at 21:52 UTC
    I have the same problem here, I run Ubuntu Desktop 9.04 as server with apache as webserver with the perl module, and when I try to run some cgi scripts that I created in the past with WebDB to comfort the connection section(was with perl 5.8). But now (with 5.10 which is default in Ubuntu 9.04) I get the message "Can't locate WebDB.pm in @INC", is this a bug in 5.10 or did I do sometime wrong? please help me you're my last hope. Thanks in advance. Greetz, a Proud Perl Programmer
      is this a bug in 5.10 or did I do sometime wrong?

      Probably the latter. Try to ask these questions and see if that helps:

      • Where is the module (WebDB) installed in my machine
      • Is that directory listed in the error message? (where the contents of @INC is listed)
      • citromatik

        First thing you can't install WebDB from cpan so I had to download it manually and after the configuration I placed the file in this location /usr/lib/apache2/webdb, where it always was. After that I get an error in error.log from apache when I tried to access the cgi file: Sat May 30 00:33:50 2009 error client xx.xxx.xxx.xxx Can't locate WebDB.pm in @INC (@INC contains: /usr/lib/apache2/webdb /etc/perl /usr/local/lib/per$ Sat May 30 00:33:50 2009 error client xx.xxx.xxx.xxx BEGIN failed--compilation aborted at /var/www/index.cgi line 6. Sat May 30 00:33:50 2009 error client xx.xxx.xxx.xxx Premature end of script headers: index.cgi The strange thing is that everything worked in the past with ubuntu 8.04 en now with 9.04 it doesn't. I really hope you can help. Pr0t0n

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://722382]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-19 11:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found