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: get.pl
(395 B)
Path: /usr/share/doc/perl-HTTP-Tiny/eg/get.pl
Back
#!/usr/bin/perl use strict; use warnings; use HTTP::Tiny; my $url = shift(@ARGV) || 'http://example.com'; my $response = HTTP::Tiny->new->get($url); print "$response->{status} $response->{reason}\n"; while (my ($k, $v) = each %{$response->{headers}}) { for (ref $v eq 'ARRAY' ? @$v : $v) { print "$k: $_\n"; } } print $response->{content} if length $response->{content};