Home > Archive > PERL Miscellaneous > April 2004 > Perl can't find packages that are there
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Perl can't find packages that are there
|
|
| Noel Sant 2004-04-25, 2:33 pm |
| I run a nightly Perl program which uses WinZip's command-line version
(WZZIP) to archive data that has changed. It is a scheduled job and has been
running fine and ran OK last night (Sat/Sun) at five minutes past midnight.
I am using Windows 2000 and ActivePerl 5.8.0.
I ran it "manually" to-day (i.e. right-click on the scheduled job icon and
clicked "Run") and got a message:
=============== DOS box ====================================
Can't locate strict.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib
..) a
t D:\Housekeeping\BackupWithZip\Scripts\Ba
ckupWithZip.pl line 264.
BEGIN failed--compilation aborted at
D:\Housekeeping\BackupWithZip\Scripts\Ba
cku
pWithZip.pl line 264.
Return code from BackupWithZip was 2
=============== End of DOS box ===============================
Line 264 is "use strict;".
But if I use Windows explorer to look at C:/Perl/lib I can see strict.pm
there!
I've done nothing to Perl to-day. I _have_ used Norton Ghost to create an
image of my C: drive to a disk in a mobile rack, my H: and I: partitions,
and I then removed this hard drive and replaced it with another. My Perl
program writes to the I: drive but it's nowhere near that bit. I've
re-booted but it still happens: before the re-boot it was Carp.pm it was
complaining about, and at "use diagnostics;" on the line following "use
strict;". Carp.pm is also in C:/Perl/lib, plus there's a folder called
"Carp" which contains "Heavy.pm".
My path is:
C:\Perl\bin\;C:\WINNT\system32;C:\WINNT;
C:\WINNT\System32\Wbem;"C:\Program
Files\Norton SystemWorks\Norton Ghost\";C:\Program Files\UltraEdit;C:\Batch.
I can't find an environment variable @INC but I assume this is a temporary
one that Perl sets up when it runs.
I just can't imagine what's going on. HELP!
Regards,
Noel
| |
| James Willmore 2004-04-27, 2:06 am |
| On Sun, 25 Apr 2004 18:57:10 +0100, Noel Sant wrote:
[ ... ]
> =============== DOS box ====================================
> Can't locate strict.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib
> .) a
> t D:\Housekeeping\BackupWithZip\Scripts\Ba
ckupWithZip.pl line 264.
> BEGIN failed--compilation aborted at
> D:\Housekeeping\BackupWithZip\Scripts\Ba
cku
> pWithZip.pl line 264.
> Return code from BackupWithZip was 2
> =============== End of DOS box ===============================
>
> Line 264 is "use strict;".
Why isn't "use strict;" on, say, line 3? In order for strictures to be
useful and effective, it should be used as early as possible. Unless you
have about 250+ lines of comments :-)
[ ... ]
> My path is:
> C:\Perl\bin\;C:\WINNT\system32;C:\WINNT;
C:\WINNT\System32\Wbem;"C:\Program
> Files\Norton SystemWorks\Norton Ghost\";C:\Program Files\UltraEdit;C:\Batch.
> I can't find an environment variable @INC but I assume this is a temporary
> one that Perl sets up when it runs.
@INC is the equivlent to "include" in C/C++ and "import" in Java. It's
Perl's include path and is a part of the language, not part of an
environment variable (well, it is in a way, but let's focus on just the
@INC, shall we :-) ).
Just an idea - have you tried to run a small script to see if "use
strict;" works? Something like ....
---------------------
#!C:/perl/bin/perl
use strict;
use warnings;
print "Okay!\n";
---------------------
If this works, then the real issue is the way your script was written.
If it doesn't, then something with your install of Perl got fouled.
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
"I do not fear computers. I fear the lack of them." -- Isaac
Asimov
| |
| Noel Sant 2004-04-27, 2:10 am |
|
"James Willmore" <jwillmore@remove.adelphia.net> wrote in message
news:pan.2004.04.26.18.30.20.501380@remove.adelphia.net...
> On Sun, 25 Apr 2004 18:57:10 +0100, Noel Sant wrote:
>
> [ ... ]
>
C:/Perl/site/lib[color=darkred]
>
> Why isn't "use strict;" on, say, line 3? In order for strictures to be
> useful and effective, it should be used as early as possible. Unless you
> have about 250+ lines of comments :-)
262 lines of comments, actually - and a blank line!
>
> [ ... ]
>
C:\Perl\bin\;C:\WINNT\system32;C:\WINNT;
C:\WINNT\System32\Wbem;"C:\Program[color=darkred]
Files\UltraEdit;C:\Batch.[color=darkred]
temporary[color=darkred]
>
> @INC is the equivlent to "include" in C/C++ and "import" in Java. It's
> Perl's include path and is a part of the language, not part of an
> environment variable (well, it is in a way, but let's focus on just the
> @INC, shall we :-) ).
>
> Just an idea - have you tried to run a small script to see if "use
> strict;" works? Something like ....
>
> ---------------------
> #!C:/perl/bin/perl
>
> use strict;
> use warnings;
>
> print "Okay!\n";
> ---------------------
>
> If this works, then the real issue is the way your script was written.
> If it doesn't, then something with your install of Perl got fouled.
Your test prog, exactly as you wrote it, works fine. Furthermore, the
scheduled program worked OK last night, again. So I've just tried to run it
again manually - and it's working!!! I simply don't know what I did
different - in each case, I right-clicked the scheduled job and then clicked
run. I don't think I've re-booted since I last tried it manually and it
didn't work, and I'm sure I did re-boot yesterday between two manual runs
that didn't work. Oh well, thanks very much for your help, anyway.
Regards,
Noel
|
|
|
|
|