programming-examples/perl/Network/Using getstore() to Print an Invalid Page.pl

15 lines
304 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl -w
use LWP::Simple;
use strict;
my $status = getstore("http://www.demo.org/nofile.aspx","/tmp/demo");
unless (is_success($status)) {
die "Couldn't retrieve page: ${$status}";
}
open (PAGE, "/tmp/demo") or die "$!";
while (<PAGE>) {
print();
}
close(PAGE);