Skip to content

Instantly share code, notes, and snippets.

@jasin
Last active August 21, 2016 14:18
Show Gist options
  • Save jasin/4e52c4718fd141c5ddfeab65ff68387a to your computer and use it in GitHub Desktop.
Save jasin/4e52c4718fd141c5ddfeab65ff68387a to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
print "What site would you like to check?";
my $site = <STDIN>;
print "What file would you lke to save to?";
my $file = <STDIN>;
$file =~ s/[\n\r\f\t]//g;
my $content = getstore($site, $file);
die "Couldn't get it!" unless defined $content;
my $hashref = head($site);
die "Couldn't get it!" unless defined $hashref->header('content_type');
print($hashref->as_string());
print "Site is $site\n";
print "file is $file\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment