Beta Shell
v2.0 ยท web2.us.cloudlogin.co
[FM]
[CMD]
[PHP]
[DB]
[INFO]
[SEC]
File Manager
~
/
usr
/
share
/
doc
/
perl-HTTP-Tiny
/
eg
Upload
5 items
Name
Size
Perms
Modified
Actions
[ .. / .. ]
get.pl
395 B
-rw-r--r--
2018-07-30 19:36:01
Edit
Del
mirror.pl
392 B
-rw-r--r--
2018-07-30 19:36:01
Edit
Del
post.pl
568 B
-rw-r--r--
2018-07-30 19:36:01
Edit
Del
Editing: mirror.pl
(392 B)
Path: /usr/share/doc/perl-HTTP-Tiny/eg/mirror.pl
Back
#!/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"; } }