How do I download a file using Perl?

后端 未结 4 625
天涯浪人
天涯浪人 2020-12-23 10:14

I\'m running Perl on Windows XP, and I need to download a file from the URL http://marinetraffic2.aegean.gr/ais/getkml.aspx.

How should I do this? I have attempted u

4条回答
  •  情深已故
    2020-12-23 10:55

    I'd use LWP::Simple for this.

    #!/usr/bin/perl
    
    use strict;
    use warnings;
    
    use LWP::Simple;
    
    my $url = 'http://marinetraffic2.aegean.gr/ais/getkml.aspx';
    my $file = 'data.kml';
    
    getstore($url, $file);
    

提交回复
热议问题