in reply to Re: from 5.8 to 5.10
in thread from 5.8 to 5.10

... 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

Replies are listed 'Best First'.
Re^3: from 5.8 to 5.10
by szabgab (Priest) on Nov 08, 2008 at 13:38 UTC
    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.

      Could try adding
      BEGIN{unshift @INC, sub{warn join q, ! ,, @_, caller;}; }
      example
      C:\>perl -e"BEGIN{unshift @INC, sub{warn join q, ! ,, @_, caller;}; } + use Fjord; use CGI;" CODE(0x225d98) ! Fjord.pm ! main ! -e ! 1 at -e line 1. CODE(0x225d98) ! CGI.pm ! main ! -e ! 1 at -e line 1. CODE(0x225d98) ! Carp.pm ! CGI ! C:/Perl/lib/CGI.pm ! 3 at -e line 1. CODE(0x225d98) ! Exporter.pm ! Carp ! C:/Perl/lib/Carp.pm ! 193 at -e +line 1. CODE(0x225d98) ! CGI/Util.pm ! CGI ! C:/Perl/lib/CGI.pm ! 27 at -e lin +e 1. CODE(0x225d98) ! strict.pm ! CGI::Util ! C:/Perl/lib/CGI/Util.pm ! 3 a +t -e line 1. CODE(0x225d98) ! vars.pm ! CGI::Util ! C:/Perl/lib/CGI/Util.pm ! 4 at +-e line 1. CODE(0x225d98) ! warnings/register.pm ! vars ! C:/Perl/lib/vars.pm ! 7 + at -e line 1. CODE(0x225d98) ! warnings.pm ! warnings::register ! C:/Perl/lib/warnin +gs/register.pm ! 24 at -e line 1. CODE(0x225d98) ! constant.pm ! CGI ! C:/Perl/lib/CGI.pm ! 33 at -e lin +e 1. CODE(0x225d98) ! overload.pm ! Fh ! C:/Perl/lib/CGI.pm ! 3717 at -e li +ne 1. C:\>
      package WebDB; use warnings; use strict; use DBI; use utf8; use Encode qw(decode encode); binmode(STDOUT, ':utf8'); my $host_name = "xxx"; my $db_name = "xxx"; my $dsn = "DBI:mysql:database=$db_name;host=$host_name;"; # Connect to MySQL server, using hardwired name and password sub connect { return (DBI->connect ($dsn, "xxx", "xxx", {RaiseError => 1, mysql +_enable_utf8 => 1}) or die ("Cannot connect: $DBI::errstr")); } sub Get_Item_Table { my $dbh = shift; my $ref = shift; my $sql_item = qq(SELECT ID_catalogo, tavoletta, scuola, tipolog +ia, tipo, copia_di FROM CATALOGO WHERE tavoletta LIKE '$ref%'); my $sth_item = $dbh->prepare($sql_item); $sth_item->execute(); return($sth_item); } sub parsing { my $riga = shift; # ? e ! $riga =~ s/(\?)/<sup>$1<\/sup>/g; $riga =~ s/(\!)/<sup>$1<\/sup>/g; $riga =~ s/(@)/&nbsp;/g; $riga =~ s/ /&nbsp;&nbsp;/g; $riga; } 1;
        I don't see anything in there related.

        I even tried to load it on my newly upgraded Ubuntu 8.10 with perl 5.10 and it said everything is ok.

        It's possible (I guess) that you have an outdated version of one of the modules here that would somehow require B::Bytecode. (The first thing I'd try is updating them, anyway.) One way to see where the problem is is to precede every use with a diagnostic message:
        BEGIN { warn "About to use a"; } use a; BEGIN { warn "About to use b"; } use b;
        (The BEGINs are necessary because use statements are implicitly wrapped in BEGINs themselves.) If you don't see About to use b, then you'll know that the error was caused somewhere in the course of executing use a.

        UPDATE: On further reading (and a bit of clumsy line-counting), it looks like the error is being thrown on the DBI->connect line. I don't have DBI installed, so can't test; but maybe someone else knows whether this method might try to use B::Bytecode for some reason?