[plug] Calling Perl Programmers to solve PLUG issue

Tim weirdit at gmail.com
Sun Mar 1 14:51:23 WST 2009

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.

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

The part of the script that we are focussing on in particular is below

5 use FindBin;
6 use lib "$FindBin::Bin";
7 use PLUG::Site 'local';
8 use PLUG::Member;

The error is below.

Can't locate PLUG/Site.pm in @INC (@INC contains: /web/members/local
.. /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4
/usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8
/usr/local/lib/site_perl .) at
/web/members/local/mailout-expired-lastmonth-members.pl line 7.
BEGIN failed--compilation aborted at
/web/members/local/mailout-expired-lastmonth-members.pl line 7.

So obviously, @INC doesn't include the relevant directory. BUT, it
does include it if I execute the script from a shell!?!? So I'm a
little lost, as I didn't expect perl to be effected by shell
environment variables to do with modules.

So please, kind, great perl programmer, step up and solve plugs little
scripting problem, so I can `svn ci` this problem for the last time,
and known that next month, on april fool's day, I won't get an email
telling me that it died again. (Actually, I won't get the email till
much later in April as I'll be on my honeymoon, but I'll still get it


Timothy White - Somewhere in Australia

More information about the plug mailing list