Does the test of the file-size make sense here? I tried to cut the connection while downloading, but it looks like the size-test is never reached.
#!/usr/bin/env perl
use warnings;
use strict;
use 5.012;
use LWP::Simple;
my $url = 'http://www.kernel.org/pub/linux/kernel/v2.6/next/patch-v2.6.34-rc5-next-20100428.bz2';
my $file = 'next_kernel.bz';
my $file_size = '3462166';
my $response = getstore( $url, $file );
if ( is_success $response ) {
if ( $file_size == -s $file ) {
say "OK";
}
else {
say "Not OK";
}
}