(Note: I suck at Perl.)

I have a script. it's a simple script.

#!/usr/bin/perl
$file = "foo.txt";
system"wget http://clutter.pbp.net/~jnichols/foo.txt"; || die "Couldn't get $file";


Currently "foo.txt" doesn't exist. It'll return a 404. It doesn't die with the error message above. Basically, I need wget to die and return the specified error message if the result is *anything* but successful. If wget gets the file, ok. If it fails to get the file for any reason, barf out.

Sounds simple enough, eh? I can't seem to find documentation on how to achieve this goal. Help? :P

--
gentoo-user@gentoo.org mailing list



Reply via email to