Next Trivial Utilities 24

getstore

        #!/usr/bin/perl

        use LWP::Simple 'getstore';
        use HTTP::Status ();
        my $url = shift or die "Usage: $0 url [file]\n";
        my $file = shift;
        unless (defined $file) {
          require File::Basename;
          $file = File::Basename::basename($url);
          $file = "DEFAULT" unless defined $file;
        }
        unless (HTTP::Status::is_success(my $rc = getstore($url, $file))) {
          print HTTP::Status::status_message($rc), "\n";
          exit 1;
        }



Next Menu Copyright © 2012 M. J. Dominus