in reply to mysql error

> exists on every path in the error:

Do you say it's installed for each path listed? Seriously?

Could you show us at least one of these paths?

> HOWEVER.... I can run it in my browser with no errors

I suppose you are talking about a CGI script called via a webserver like Apache?

Webservers can have their own environment set in their configs. You might want to dump $ENV{PERL5LIB} and similar into your HTML to check.

Probably your are even using another Perl installation?

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: mysql error
by dcscott (Novice) on Feb 16, 2024 at 19:14 UTC

    You are right about different versions of perl:
    which perl
    /usr/local/bin/perl

    Script: #!/usr/bin/perl

    If I change the script to: #!/usr/local/bin/perl
    It chokes.

    Do you know how I can change perl to /usr/bin/perl in debian 8?

      It's the order in your $PATH environmental variable:
      echo $PATH
      You can change the order to put /usr/bin/ before /usr/local/bin. Or instead of running the script like
      perl script_name.pl
      just run
      ./script_name.pl
        Thank You!
Re^2: mysql error
by dcscott (Novice) on Feb 16, 2024 at 18:22 UTC
    /usr/local/lib/perl5/site_perl/5.38.2/x86_64-linux /usr/local/lib/perl5/site_perl/5.38.2 /usr/local/lib/perl5/5.38.2/x86_64-linux /usr/local/lib/perl5/5.38.2)
Re^2: mysql error
by dcscott (Novice) on Feb 16, 2024 at 18:47 UTC
    The best I can tell, $ENV{PERL5LIB} is empty. @e = $ENV{PERL5LIB}; $n = @e; $l = length(@e); print "l = $l
    \n"; print "n= $n
    \n"; print "@e"; print "
    \n"; This returns nothing either from my browser or the command line.