On Wed, Jul 29, 2009 at 9:11 AM, Saifi Khan <saifi.k...@twincling.org>wrote:

>
>
> On Wed, 29 Jul 2009, anirudh nair wrote:
>
> > Hii guys
> >
> > I wrote this Perl code to find duplicate files in a directory.
> >
> > sub md5_finder{
> > open(FILE, $_[0]) or die "Can't open $_[0]: $!";
> > binmode(FILE);
> > Digest::MD5->new->addfile(*FILE)->hexdigest;
> > }
>
> Aniruddh, how does the md5_finder() function work ?
>
>  .
>

md5_finder() takes the file path as its argument.
A file handle FILE is opened to $_[0](which conatins the path)
then Digest::MD5->new->addfile(*FILE)->hexdigest calculates the md5 digest
and is returned back.
hexdigest returns the digest in hexadecimal form

Cheers
Anirudh


[Non-text portions of this message have been removed]

Reply via email to