Hi All !
Who can explain me, why same code on ruby much more slow then same on perl
I need fetch reports for publication on WEB (Intranet)
ruby’s script do it by cron every day
sample code
···
#!/usr/bin/ruby
require ‘net/ftp’
ftp = Net::FTP.new(‘E0152’)
st = ftp.login(“opecon”, “123”,0)
files = ftp.chdir(’/home/opecon’)
ftp.gettextfile(‘DAILYC’, ‘DAILYC’)
puts "Fetch DailyC Ok"
ftp.gettextfile(‘DAILY’, ‘DAILY’)
puts "Fetch Daily Ok"
ftp.close
#!/usr/local/bin/perl -w
use strict;
use Net::FTP;
my $ics=“E0152”;
my $user = “opecon”;
my $password = “123”;
my $ftp = Net::FTP->new($ics) or die “Can’t connect $@\n”;
$ftp->login($user, $password) or die “Couldn’t login $@\n”;
$ftp->cwd(’/home/opecon’) or die “Couldn’t change directory\n”;
my @lines = $ftp->ls(“DAI*”);
foreach my $line (@lines) {
$ftp->get($line, $line) or die “Can’t fetch $line: $!\n”;
print "Fetch file => ", $line;
print “\n”;
}
$ftp->quit();
Any tips ?