cksum module

Z

zeke03

Hello,

I have a question concerning the String-CRC-Cksum-0.03 CPAN module.

I have downloaded Cksum.pm and Makefile.PL and put it in c:\perl\lib\cksum (i
work on Windows and i would work on unix and linux after)
I have launched "perl Makefile.PL", then the file Makefile has been create in
c:\perl\lib\cksum folder.

My little perl program, in a folder, i want to do a cksum to each files in the
folder (i am a beginner) doesn't work :

use String::CRC::Cksum;
use String::CRC::Cksum qw(cksum);
use File::Spec;

$reptra='c:\temp\data_integrity';
chdir $reptra or die "Can't go in work folder Because: $! \n";

### Globalisation
my @all_files = glob "*";
print Dumper @all_files;

### Threat

foreach $arg (@all_files)
{
$cksum=cksum($arg);
print "CHECK SUM = $cksum \n\n";
}


=> perl d:\ssh_integre.pl
Can't locate String/CRC/Cksum.pm in @INC (@INC contains: C:/Perl/lib) at
d:\ssh_integre.pl line 1.
BEGIN failed--compilation aborted at d:\ssh_integre.pl line 1.



Can someone help me ?

Thanks

(e-mail address removed)
 
A

Anno Siegel

zeke03 said:
Hello,

I have a question concerning the String-CRC-Cksum-0.03 CPAN module.

I have downloaded Cksum.pm and Makefile.PL and put it in c:\perl\lib\cksum (i
work on Windows and i would work on unix and linux after)
I have launched "perl Makefile.PL", then the file Makefile has been create in
c:\perl\lib\cksum folder.

That is only the first step. You need to run "make", "make test", and
"make install" to install the module.
My little perl program, in a folder, i want to do a cksum to each files in the
folder (i am a beginner) doesn't work :

use String::CRC::Cksum;
use String::CRC::Cksum qw(cksum);
use File::Spec;

$reptra='c:\temp\data_integrity';
chdir $reptra or die "Can't go in work folder Because: $! \n";

### Globalisation
my @all_files = glob "*";
print Dumper @all_files;

### Threat

foreach $arg (@all_files)
{
$cksum=cksum($arg);
print "CHECK SUM = $cksum \n\n";
}


=> perl d:\ssh_integre.pl
Can't locate String/CRC/Cksum.pm in @INC (@INC contains: C:/Perl/lib) at
d:\ssh_integre.pl line 1.

That's no surprise, since you haven't installed the module.

Your @INC doesn't look right either. I don't know what it is supposed
to hold on a windows system, but there's usually more than just one
directory in it.

Anno
 
S

Sisyphus

zeke03 said:
Hello,

I have a question concerning the String-CRC-Cksum-0.03 CPAN module.

I have downloaded Cksum.pm and Makefile.PL and put it in c:\perl\lib\cksum (i
work on Windows and i would work on unix and linux after)
I have launched "perl Makefile.PL", then the file Makefile has been create in
c:\perl\lib\cksum folder.

Normally, you would extract String-CRC-Cksum-0.03.tar.gz to a directory
*outside* of the perl installation, cd to the 'String-CRC-Cksum-0.03'
folder within that directory, and run the following 4 commands:
perl Makefile.PL
make
make test
make install

You would replace 'make' in the above with whatever 'perl -V:make' reports.

This module is, however, pure-perl (no compilation necessary), so you
could simply place 'Cksum.pm' in any of the folders listed in @INC and
that would work.

Cheers,
Rob
 
B

Ben Morrow

Your @INC doesn't look right either. I don't know what it is supposed
to hold on a windows system, but there's usually more than just one
directory in it.

IIRC C:/Perl/lib is all that @INC has in it for a default install of
ActiveState.

Ben
 
A

Anno Siegel

Ben Morrow said:
IIRC C:/Perl/lib is all that @INC has in it for a default install of
ActiveState.

I'd have expected something like site_perl even there, but what do I know :)

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top