文件操作 - mirror.pl
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/doc/perl-HTTP-Tiny/eg/mirror.pl
编辑文件内容
#!/usr/bin/perl use strict; use warnings; use HTTP::Tiny; my $url = shift(@ARGV) || 'http://example.com'; my $file = shift(@ARGV) || 'example.output'; my $response = HTTP::Tiny->new->mirror($url, $file); print "$response->{status} $response->{reason}\n"; while (my ($k, $v) = each %{$response->{headers}}) { for (ref $v eq 'ARRAY' ? @$v : $v) { print "$k: $_\n"; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件