in reply to Re: lwp-download program
in thread lwp-download program

The lwp-download script actually checks for existing files and then prompts you before it overwrites them. Unfortunately that part of the program stopped working in the download subroutine.
# Check if the file is already present if (-f $file && -t) { $shown = 1; print "Overwrite $file? [y] "; my $ans = <STDIN>; unless (defined($ans) && $ans =~ /^y?\n/) + { if (defined $ans) { print "Ok, aborting.\n"; } else { print "\nAborting.\n"; } exit 1; } $shown = 0; } else { print "Saving to '$file'...\n"; }
I will try your suggestion to use system instead of the subroutine.

Replies are listed 'Best First'.
Re^3: lwp-download program
by pccode (Novice) on May 29, 2005 at 20:32 UTC
    The system function solves the problem. Thanks.