Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Perl支持internet吗?_Perl_Crontab - Fatal编程技术网

Perl支持internet吗?

Perl支持internet吗?,perl,crontab,Perl,Crontab,我试着用Perl脚本来下载网站上的文件。脚本必须在夜间自动下载。Perl支持internet吗?我将Perl5与CentOS和GEDIT一起使用 use File::Fetch; my $url = 'http://domain.tld/path'; my $ff = File::Fetch->new(uri => $url); my $file = $ff->fetch() or die $ff->error; print "Check $file\n"; 把它放到脚

我试着用Perl脚本来下载网站上的文件。脚本必须在夜间自动下载。Perl支持internet吗?我将Perl5与CentOS和GEDIT一起使用

use File::Fetch;
my $url = 'http://domain.tld/path';
my $ff = File::Fetch->new(uri => $url);
my $file = $ff->fetch() or die $ff->error;
print "Check $file\n";

把它放到脚本中,然后…

我不确定Perl是否是解决问题的最佳方案。您可能会发现简单地使用命令行工具(如curl)更容易。例如,以下命令将从其CDN位置下载堆栈溢出横幅,并将数据保存到名为test.png的本地文件中:

curl https://s.zkcdn.net/Advertisers/6a84d696ad6c4679804e4923a617ade4.png > test.png

问题不是Perl是否支持internet,而是internet是否支持Perl。谢谢。您的解决方案适合我。是的,但我需要Perl脚本下载文件网站。