[olug] Challenge With Perl Module Tk

Jay Hannah jay at jays.net
Sat Aug 2 15:13:38 UTC 2003


I downloaded the source (version: 2.0.0). "bastille" is a shell script. 
The relevant bit appears to start on line 248:

--------
        for mod in "Tk"
          do
        # see if perl can find the module
          ${CURRENT_PERL_PATH}/perl -M$mod < /dev/null > /dev/null 2>&1
          if [ $? != 0 ]; then
        # Cannot find module
              retval=2
              if [ $missingmod = 0 ]; then
            # First error message printed here
                  missingmod=1;
                  echo >&2 "$ERRORWARN ${CURRENT_PERL_PATH}/perl cannot find Perl module $mod."
              else
                  echo >&2 "$ERRSPACES ${CURRENT_PERL_PATH}/perl cannot find Perl module $mod."
              fi
          fi
        done
--------

And your stuff is here (previous email):

---
[root at phoenix root]# whereis perl
perl: /usr/bin/perl

[root at phoenix root]# find / -name Tk.pm -print
/usr/lib/perl5/site_perl/5.6.1/i386-linux/Tk.pm
---

When you type "perl -V" is one of the paths in @INC 

   /usr/lib/perl5/site_perl/5.6.1/i386-linux

? If not, you could 

   export PERL5_LIB=/usr/lib/perl5/site_perl/5.6.1/i386-linux

If you type this

   /usr/bin/perl -MTk -e ''

do you get an error?

You could reproduce the shell behavior w/ a little script like this:

/usr/bin/perl -MTk < /dev/null > /dev/null 2>&1
if [ $? != 0 ]; then
   echo "Error"
fi

Call that test.sh or whatever. Does it print "Error"?

HTH,

j


More information about the OLUG mailing list