Dear Perlers, I need to download a file from a server using FTP and then I need to compare both files (MD5 Checksum) to ensure that I am testing the right build.
Here is the program I have attempted so far. Please throw some light in comparing the MD5 checksum of the source and destination files. [code] use strict; use warnings; use Digest::MD5::File qw( file_md5_hex ); use Net::FTP; my $server_name = 'codeinside.com'; my $ftp_username = 'mx345fg'; #Real username and password changed for security reasons my $ftp_password = 'k*&^%$_(_'; my $ftp_source_dir = '/public_html/Shaji'; my $ftp_source_image = 'confidence.jpg'; #Located in remote server my $ftp_destination_image = 'confidence.jpg'; my $ftp = Net::FTP->new($server_name, Debug => 1); $ftp->login($ftp_username,$ftp_password); $ftp->cwd($ftp_source_dir); $ftp->binary(); $ftp->get($ftp_source_image, $ftp_destination_image); $ftp->quit; my $md5_source = file_md5_hex( $ftp_source_image ); my $md5_destination = file_md5_hex( $ftp_destination_image ); #Need clarification here. Am I doing the right way? print "Files are identical" if ($md5_source eq $md5_destination); [/code] best, Shaji ------------------------------------------------------------------------------- Your talent is God's gift to you. What you do with it is your gift back to God. ------------------------------------------------------------------------------- -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/