[plug] Calling Perl Programmers to solve PLUG issue
Jason Nicholls
jason at mindsocket.com.au
Sun Mar 1 15:35:28 WST 2009
Just use an absolute path, or have you tried this already? i.e.
use lib '/web/members/PLUG'
(or wherever the absolute directory is)
Yeah it will break if it moves but it'd break anyway and my guess is it
hasn't moved in 10+ years.
On Sun, Mar 01, 2009 at 03:51:23PM +1000, Tim wrote:
> 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
> eventually!)
>
> Thanks
>
> Tim
> --
> Timothy White - Somewhere in Australia
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://www.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au
Regards,
Jason Nicholls
--------------------------------------------------------------------
Jason Nicholls email: <jason at mindsocket.com.au>
http://jason.mindsocket.com.au/ mobile: +61 430 314 857
--------------------------------------------------------------------
pgp/gpg id: 0xC3844959
fingerprint: 7F7A 5846 4E94 459C 104D A979 7079 24CF C384 4959
More information about the plug
mailing list