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

Dear monks,
I run a Solaris 8 machine (sparc) at work and had problems installing DBI for perl 5.6.0 - it seems that compiling modules with gcc when the system perl is precompiled with a Sun compiler is a problem. Anyway to cut a long story short I got 5.6.1 from CPAN, compiled with gcc - and installed DBI..
Now I suffer from the following style error:

BEGIN failed--compilation aborted at /usr/apache/htdocs/mrbs/badpw.pl line 8. Can't locate strict.pm in @INC (@INC contains: /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5 +/site_perl/5.6.1 /usr/local/lib/perl5/site_perl .) at /usr/apache/htdocs/mrbs/badpw.pl +line 8.

obviously @INC seems not to include the path to strict.pm from this error message but :

# perl -e 'use strict; print map {"$_ => $INC{$_}\n"} keys %INC' stric +t.pm => /usr/local/lib/perl5/5.6.1/strict.pm

and :

# perl -e 'print join "\n", @INC' | grep 5.6.1 /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1

I'm just terribly confused - I've searched all over and not found a satisfactory answer, so I submit it to your wisdom.
Thanks in advance..
dan

Edit by tye to replace <pre> with <code> due to long lines

Replies are listed 'Best First'.
Re: perl 5.6.0-5.6.1 upgrade problem
by mugwumpjism (Hermit) on Aug 07, 2001 at 17:53 UTC

    I suggest you use truss on the program that is failing, and then look for a series of lines that will be something like access("/path/strict.pm")    = ENOENT.

    eg,

    $ truss -f -o /tmp/truss.out perl /usr/apache/htdocs/mrbs/badpw.pl

    If the generated truss.out is too confusing, then mail it to me (compressed :-)) at sam at vilain dot net. If you search for "strict.pm" you'll probably find out what you're looking for.

      OK truss is beyond me (for the time being!) I have sent the files to Sam. If anyone else is interested in looking at them I have put them on a site
      the tarball decompresses to a truss/ directory with two truss outputs - one with strict commented out from the script and one with the strict left in (truss.out.strict_on)
      I assumed these would be useful for comparison
      dan (god I love this site :))
        It looks like it's loading it correctly:
        18076: stat64("/usr/local/lib/perl5/5.6.1/sun4-solaris/strict.pmc", 0 +xFFBEF068) Err#2 ENOENT 18076: open64("/usr/local/lib/perl5/5.6.1/sun4-solaris/strict.pm", O_ +RDONLY) Err#2 ENOENT 18076: stat64("/usr/local/lib/perl5/5.6.1/strict.pmc", 0xFFBEF068) Er +r#2 ENOENT 18076: open64("/usr/local/lib/perl5/5.6.1/strict.pm", O_RDONLY) = 4 18076: brk(0x00104800) = 0 18076: fstat64(4, 0xFFBEC950) = 0 18076: brk(0x00108800) = 0 18076: ioctl(4, TCGETA, 0xFFBEC8DC) Err#25 ENOTTY 18076: read(4, " p a c k a g e s t r i".., 8192) = 2624 18076: brk(0x00109800) = 0 18076: brk(0x0010A800) = 0 18076: read(4, 0x0010480C, 8192) = 0 18076: llseek(4, 0, SEEK_CUR) = 2624 18076: close(4) = 0

        You can see at the top of the snippet (from truss.out.strict_on) that it is trying to "stat" and "open" strict.pm in different locations, and the last one succeeds (returning a file handle number, 4). The following lines show perl reading in the file and closing it again.

        Did you actually get an error when you ran the script with truss? You really need to stick the truss in the place where the script is giving you the error.

        Update: He found his problem. It was permissions on the directory strict.pm was in.

Re: perl 5.6.0-5.6.1 upgrade problem
by physi (Friar) on Aug 07, 2001 at 17:24 UTC
    How do the first eight lines of your /usr/apache/htdocs/mrbs/badpw.pl look like?
    Are you using the right #!/usr/local/bin/perl first line ??
    and what does perl -v say about it's version ?
    ----------------------------------- --the good, the bad and the physi-- -----------------------------------
      Hi,
      I'm pretty sure the scripts are pointing to the right perl binaries:
      # head -n 8 /usr/apache/htdocs/mrbs/badpw.pl
      #!/usr/bin/perl
      
      # $Id: badpw.pl,v 1.3 2001/02/25 01:34:20 lbayuk Exp $
      
      # Read AUTHENTICATION for more information
      # about this script
      
      use strict;
      

      and:
      
      # ls -asl /usr/bin/perl
      1840 -rwxr-xr-x   3 root     other     927784 Aug  6 16:53 /usr/bin/perl
      # /usr/bin/perl -v
      
      This is perl, v5.6.1 built for sun4-solaris
      
      Copyright 1987-2001, Larry Wall
      
      

      :(
      dan
        Funny, above you wrote your INC contains /usr/local/lib ...
        are you sure you have to use /usr/bin/perl and not /usr/local/bin/perl ?
        ----------------------------------- --the good, the bad and the physi-- -----------------------------------
Re: perl 5.6.0-5.6.1 upgrade problem
by jlongino (Parson) on Aug 07, 2001 at 18:21 UTC
    You should check your path statement. It sounds like you may have different versions of the perl binary floating around. I recently upgraded a Solaris 7.0 to perl 5.6.1 and found that the Web Administrator had put copies of the older version in /bin and /usr/bin as well as having copies in /usr/local/bin and /usr/local.
      mendel:~ $PATH
      bash: /usr/bin:/usr/ucb:/etc:/usr/local/bin:/usr/ccs/bin:/root
      
      I did a
      find / -name perl
      and /bin/perl /usr/bin/perl /usr/local/bin/perl (-v) all report 5.6.1
      cheers!
      dan
        OK guys, thanks for all the help. This is probably due to incompetence on my part as an admin (no formal training after all ;)). Certain scripts are running fine with 'strict' and it *appears to be user dependent* - I will persue this now as an admin problem not a perl one.
        This has been a real experience posting here, hope I can put back in at some point
        dan
        The only other thing I can suggest is downloading the Solaris version appropriate Perl binaries and install via pkgadd. That's how I've installed on my 5 Sun boxes. I had no other problems except the Web Administrator snafu.

        They are available at the Freeware for Solaris site.