Rich Shepard wrote:
> On Wed, 20 May 2009, Roderick A. Anderson wrote:
>
>> Try removing the '2>/dev/null' portion from the line in the script and
>> rerun. I script seems to be testing if Date::Calc exists and 'if not'
>> do some other stuff.
>
> Rod,
>
> Yes, I saw that it's testing for the existance of Date::Calc and doesn't
> seem to do anything specific if it's not there. But, the module exists so I
> ignored that. Removing '2>/dev/null' makes no difference.
>
> What are the results of perl -d 'use Date::Calc'.
>
> [rshep...@salmo ~]$ perl -d 'use Date::Calc'
> Can't open perl script "use Date::Calc": No such file or directory
OOPS! My bad. Should be with a -e like in the script.
>> Also check of you have multiple versions of Perl installed. You logged
>> in as root may have a different path than cron does so gets the "Wrong
>> Perl". (Apologies to Nick Park)
>
> No, only one /usr/bin/perl and nothing otherwise.
OK well the logic on the perl line has an order. I just tried a test
and what is happening is if the Date::Calc module is there don't do the
(anonymous) sub/function.
perl -e 'use Date::Calc' || { echo hello; }
does nothing.
perl -e 'use Date::XXX' || { echo hello; }
gets
Can't locate Date/XXX.pm in @INC (@INC contains:
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7
/usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7
/usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/5.8.8 .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
So the script is saying if the Date::Calc module is _missing_ then set
stuff up to run and run pflogsumm.pl
From my copy of pflogsumm there is these lines
=head1 REQUIREMENTS
Pflogsumm requires the Date::Calc module, which can be obtained from
CPAN at http://www.perl.com.
The logic seems backwards. I think you should try changing the logic
from an 'or (||)' to an 'and (&&)'
# perl -e 'use Date::Calc;' 2>/dev/null || {
perl -e 'use Date::Calc;' 2>/dev/null && {
\\||/
Rod
--
>
> Thanks,
>
> Rich
> _______________________________________________
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug