Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

finding modules for perl 5.6.1

by Sihal (Pilgrim)
on Oct 07, 2002 at 12:57 UTC ( #203309=perlquestion: print w/ replies, xml ) Need Help??
Sihal has asked for the wisdom of the Perl Monks concerning the following question:

This is probably the most stupid question of all but I need the module Benchmark for Perl-5.6.1 and I can't seem to find it on CPAN. ( the only thing i found is for perl 5.8.0, which won't make, of course)....
Please help! thanks a lot

Comment on finding modules for perl 5.6.1
Re: finding modules for perl 5.6.1
by rdfield (Priest) on Oct 07, 2002 at 13:01 UTC
    It's a standard module - your distribution should already have it.

    rdfield

      To verify that you've got it, as with most(all?) standard Perl modules, provided you know the name of the module, you should be able to view the perldocs for that module - if the perldocs are present, then the module is present. At a command prompt, do
      perldoc Benchmark
      If the perldoc for "Benchmark" appears, then you've got it - and the perldocs tell you how to use it.

      I'm also including a script that I wrote - I call it "pwhich", which on a *nix platform does the same thing as the "which" command - it tells you where in your search path a command exists. So, pwhich tells you where in your Perl search path(@INC) that the module appears, *AND* it tells you what version of the module is installed there - according to the $VERSION string found in the module:

      -------------------------------------------------------
      #!/usr/bin/perl -w ###################################################################### +####### # Name: pwhich # Purpose: Perl version of "which" command # Takes In: 1. Perl module name (Ex: DBI, DBD::Oracle) # # Writes Out: Either a. "No documentation found for "XYZ" # # where "XYZ" is the name of a Perl module speci +fied # by the user that does *NOT* exist, # # Or b. line 1 - the @INC location of the perl module, + and # line 2 - the $Id version of the perl module ###################################################################### +####### use strict; my $ct_args = @ARGV; if ($ct_args != 1) { print "\nUsage: pwhich <perl module name>\n\n"; print "Example: pwhich DBI\n\n"; exit; } my $perl_module = shift; my $abs_filename = `perldoc -l $perl_module 2>&1`; print "\n"; print "$abs_filename"; if ($abs_filename =~ /^No documentation found/) { print "\n"; exit; } chomp($abs_filename); open(IN,"<$abs_filename") || die "Can't open $abs_filename!"; while (<IN>) { if (/\s*\$[\w:]*VERSION\s*=/i) { print; last; } } close(IN); print "\n";
      ------------------------------------------------------

      HTH.
        Thank you for the script ;-)
Re: finding modules for perl 5.6.1
by PodMaster (Abbot) on Oct 07, 2002 at 13:15 UTC
    Benchmark is all perl, so just go ahead and download the perl5.8 version (although you should already have it).

    ____________________________________________________
    ** The Third rule of perl club is a statement of fact: pod is sexy.

Re: finding modules for perl 5.6.1
by krusty (Hermit) on Oct 07, 2002 at 13:48 UTC
    try executing the following from the command line:
    prompt>perl -e 'use Benchmark;'
    If your module isn't installed it'll give you an error "Can't locate Benchmark.pm in @INC (@INC contains blah/blah/blah)
    Begin failed -- Compilation aborted at -e line 1.

    Just a stupid trick executing code to see if a module is installed and if your perl interpreter knows how to find it. The special array @INC contains the pathway in which perl will search to find whatever modules you use and require. You could modify it at compile time with
    use lib '/path/blah/blah';
      Sorry to all, I already had it. I assumed not, and tried to install it with MCPAN.... sorry to all and please don't be too harsh on me
      Thanks a lot.
Re: finding modules for perl 5.6.1
by TStanley (Canon) on Oct 07, 2002 at 19:06 UTC
    For a complete list of modules that come with the perl distribution, you can look at perlmodlib or on your system
    type perldoc perlmodlib

    TStanley
    --------
    It is God's job to forgive Osama Bin Laden. It is our job to arrange the meeting -- General Norman Schwartzkopf
      Yup. New problem: GTop won't install under perl 5.6.1. (GTOP 0.10) .
      Says there are errors in my .c files . :'-( . Can't find libgtop anywere on the web ( it is installed correctly in my machinbe though).
      Don't understand.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://203309]
Approved by fglock
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2014-09-16 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (42 votes), past polls