我使用www-mechanize模块访问网站控件.一些html页面包含框架.我无法获取链接名称,我无法访问框架中的链接.请任何人建议正确的解决方案来解决此问题.
工作平台:Windows,Perl
提前致谢
我在FTP serever中有一系列文件夹.举个例子,
@ftp_dirs=('/Tarun/Netdomais','/Tarun/Testing','/Tarun/Tested_files')
Run Code Online (Sandbox Code Playgroud)
我需要将数组中的每个文件夹从FTP服务器下载到本地文件夹(c:\ ftp_downloaded).
我写了以下几行
use strict;
use Net::FTP;
my $ftp=Net::FTP->new("hostname",Debug=>0);
$ftp->login("user_name","password");
$ftp->cwd("/Tarun");
my @ftp_dirs=('/Tarun/Netdomais','/Tarun/Testing','/Tarun/Tested_files');
my $local='c:\ftp_downloaded';
foreach my $ftp_folder(@ftp_dirs){
$ftp->get($ftp_folder,$local);
}
Run Code Online (Sandbox Code Playgroud)
上面的代码不起作用.因为get方法仅适用于从ftp而不是文件夹下载文件.
是否可以从ftp下载文件夹?
我无法使用MIME :: Lite发送邮件.从我的桌面发送时,它将通过以下错误.错误:"SMTP无法连接到邮件服务器:错误的文件描述符"
我使用下面提到的代码.
use strict;
use MIME::Lite;
use Net::SMTP;
my $from_address = "no-reply@host.com";
my $to_address = "madhan@host.com";
my $cc_address = "madhan@host.com";
my $subject = "Test mail";
my $message_body = "Madhan test mail";
my $namer="madhankumar";
my $regards="Madhan M";
print " Sending mail from $from_address to $to_address \n";
my $person_name=ucfirst($namer).",";
my $mail_host = 'mail1.somehost.com';
my $msg = MIME::Lite->new (
From => $from_address,
To => $to_address,
Cc => $cc_address,
Subject => $subject,
Type =>'multipart/mixed'
) or die "Error creating multipart container: $!\n"; …Run Code Online (Sandbox Code Playgroud) 我需要使用Perl将纪元日期和时间字符串转换为UTC日期和时间.
请分享您的想法.
#!/usr/bin/perl
my $start_time='1448841600';
my $stop_time='1448863200';
Run Code Online (Sandbox Code Playgroud)
以上两个日期和时间采用纪元格式,应将其转换为UTC日期和时间.