简体   繁体   中英

strawberry perl: no File::Tail.pm. CPAN failed to install the module

I'm using strawberry perl to tail a file using use File::Tail .

I got the error message of the following:

Can't locate File/Tail.pm in @INC (@INC contains: c:\\strawberry\\perl\\lib C:/strawberry/perl/site/lib C:/strawberry/perl/vendor/lib C:/strawberry/perl/ lib .) at tailing.perl line 5. BEGIN failed--compilation aborted at tailing.perl line 5.

Three packages contains lib:

  • c:\\strawberry\\perl\\lib
  • C:\\strawberry\\perl\\site\\lib
  • C:\\strawberry\\perl\\vendor\\lib

where c:\\strawberry\\perl is the root directory of perl installation.
I checked all the three packages, but couldn't find File/Tail.pm .

Used cpan install, but the installation failed.

The current File::Tail distribution on CPAN has never passed its test suite on Windows . Steffen Mueller submitted a patch for Windows 5 years ago, but it has never been incorporated into the distribution on CPAN.

His patch is available here , and hallelujah, it works for me. Just unpack it anywhere and run the conventional

perl Makefile.PL
dmake
dmake test
dmake install

That's the great thing about Strawberry Perl.

C:\Users\me > cpan File::Tail

Of course, I got:

Test Summary Report
-------------------
t/10open.t       (Wstat: 0 Tests: 6 Failed: 4)
  Failed tests:  3-6
t/20tail.t       (Wstat: 0 Tests: 3 Failed: 3)
  Failed tests:  1-3
  Parse errors: Bad plan.  You planned 7 tests but ran 3.
t/30name_change.t (Wstat: 0 Tests: 1 Failed: 1)
  Failed test:  1
  Parse errors: Bad plan.  You planned 2 tests but ran 1.
Files=3, Tests=10, 32 wallclock secs ( 0.03 usr +  0.09 sys =  0.12 CPU)
Result: FAIL
Failed 3/3 test programs. 8/10 subtests failed.
dmake.EXE:  Error code 255, while making 'test_dynamic'
  MGRABNAR/File-Tail-0.99.3.tar.gz
  C:\strawberry\c\bin\dmake.EXE test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MGRABNAR/File-Tail-0.99.3.tar.gz
Running make install
  make test had returned bad status, won't install without force

So I wouldn't recommend it.

Not all modules are part of the standard module set. You should check the Perldoc Perl documentation. This contains all the standard Perl modules. If a module isn't in there, you have to install it.

As Axeman said, you can use the cpan command to install any module. Just type in cpan at the command prompt and when you get the cpan> prompt, type in install File::Tail . It should install everything for you automatically including prerequisites.

You can also look at module reviews at CPAN Ratings .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM