[plug] Calling Perl Programmers to solve PLUG issue

Daniel Pittman daniel at rimspace.net
Sun Mar 1 15:31:57 WST 2009

Tim <weirdit at gmail.com> writes:

> Ok. So for some time now we've had some scripts that do mailouts
> monthly. They work fine when run from ether a SVN checkout, or from a
> shell. But when called from (ana)CRON they DIE!  Obviously it's a path
> issue or something, because they die calling our very special "plug"
> perl module.

Actually, it looks like it dies *trying* to load your PLUG Perl module.

> I /thought/ I'd solved this problem last month, adding a "findbin"
> little thing. Of course, it didn't seem to fix the issue.

I would aim to debug why, then...

> Our script dies on line 7, the call to our special module. (NB: I
> didn't write the original backbone of the script, I just turned a
> short prewritten script into much longer things that server our
> purpose, I'm not a perl programmer normally).
> The script is stored in a directory web/members/local/ with the
> modules we need stored in web/members/PLUG/

...Hang on...

> The part of the script that we are focussing on in particular is below
> 5 use FindBin;
> 6 use lib "$FindBin::Bin";

$FindBin::Bin will return '.../web/members/local/whatever.pl', and you
want to use '.../web/members' so that ...

> 7 use PLUG::Site 'local';

... this looks in '.../web/members/PLUG/Site.pm'.

Try making that 'use lib "${FindBin::Bir}/.."' and see how you go.

Otherwise, insert 'BEGIN { print STDERR "${FindBin::Bin}\n"; }' after
line 5, report what that says.

Um, or try setting the Perl invocation to explicitly include the
directory with 'perl -I.../web/members' and see if that fixes it.

Oh, and you might want to tell those of us who don't already know which
SVN it is checked in to, just in case. :)


More information about the plug mailing list