in reply to Random wallpaper harvester

498 $word = qw("$word") if ($word =~ /\s/);
qw does not interpolate. You probably meant to do this instead:
$word = qq("$word") if ($word =~ /\s/);
534 print <<ENDHELP; 535 Hellow theres.. 536 This script (ab)uses the google image search to find an image +of 537 adequate proportions from a random word from your computers 538 dictionary file, and attempts to download it and set it as you +r 539 desktop wallpaper. If you supply words arguments, then this sc +ript 540 will use them as the basis of your search. 541 542 Usage: 543 random-bg.pl 544 random-bg.pl have 545 random-bg.pl jackie chan --delay 5 546 random_bg.pl --rotate --delay 2 547 548 If you give it words in @ARGV, it will continually show images
Arrays are interpolated in double quoted strings. You need to escape the '@' character.
210 open(TOPIC, ">$topic_file") or die "can't open $topic_file +"; 218 open(TOPIC, "$topic_file") or die "can't open $topic_file. +"; 227 open(IDFILE, ">>$id_file"); 236 open(IDFILE, $id_file); 354 open FILE, ">$file" or &debug("can't open $file\n") and re +turn 0;
You should always verify that the file opened correctly before trying to use a possibly invalid filehandle. You should include the $! or $^E variable in the error message so you know why it failed to open.

Replies are listed 'Best First'.
Re^2: Random wallpaper harvester
by Snarius (Sexton) on Mar 19, 2007 at 09:08 UTC
    Corrected. Thanks for reviewing my code.