kmlevine has asked for the wisdom of the Perl Monks concerning the following question:
I’m new at Pearl and need to ask a dumb question. I have the follwing perl script which I need to configure to my computer. I use XP pro. Outlook and Comcast.net as my isp.
What do I enter in the - open(mail,”|/usr/sbin/sendmail –t”); line if I’m using Outlook – and Comcast.net as my isp?
Thanks for your help.
#!/usr/bin/perl $searchstring = "hp designjet"; $email = "kml\@comcast.net"; $localfile = "d:/ebay hacks/search 5-27.txt"; use WWW::Search; $searchobject = new WWW::Search('Ebay'); $query = WWW::Search::escape_query($searchstring); $searchobject->native_query($query); # *** put results into two arrays *** $a = 0; while ($resultobject = $searchobject->next_result()) { $a++; ($itemnumber[$a]) = ($resultobject->url =~ m!item=(\d+)!); $title[$a] = $resultobject->title; } # *** eliminate entries already in file *** open (INFILE,"$localfile"); while ( $line = <INFILE> ) { for ($b = $a; $b >= 1; $b--) { if ($line =~ $itemnumber[$b]) { splice @itemnumber, $b, 1; splice @title, $b, 1; } } } close (INFILE); $a = @itemnumber - 1; if ($a == 0) { exit; } # *** save any remaining new entries to file *** open (OUTFILE,">>$localfile"); for ($b = 1; $b <= $a; $b++) { print OUTFILE "$itemnumber[$b]\n"; } close (OUTFILE); # *** send email with new entries found *** open(MAIL,"|/usr/sbin/sendmail -t"); print MAIL "To: $email\n"; print MAIL "From: $email\n"; print MAIL "Subject: New $searchstring items found\n\n"; print MAIL "The following new items have been listed on eBay:\n"; for ($b = 1; $b <= $a; $b++) { print MAIL "$title[$b]\n"; print MAIL "http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=$it +emnumber[$b]\n\n"; } close(MAIL);
Edited by Chady -- added code tags.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl and outlook
by neniro (Priest) on May 27, 2004 at 16:32 UTC | |
by kmlevine (Initiate) on May 31, 2004 at 20:18 UTC | |
by neniro (Priest) on May 31, 2004 at 20:59 UTC | |
by kmlevine (Initiate) on Jun 01, 2004 at 12:54 UTC | |
|
Re: perl and outlook
by chanio (Priest) on May 28, 2004 at 03:33 UTC |