in reply to K-Mart Blue Light E-mail Auto-responder

The rest of the code looks cool, but I saw this:
sub do_weather { open (WX, "/home/system/weather/wx.pl 2>&1 |"); my @wxdata = <WX>; close (WX); return (@wxdata); }
and wondered why you didn't just do something like this:
sub do_weather { `/home/system/weather/wx.pl 2>&1`; }
which would have the added advantage of having both a meaningful list context return value (broken up by lines) and scalar context return value (all the data as one string).

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
RE: RE: K-Mart Blue Light E-mail Auto-responder
by Anonymous Monk on Aug 20, 2000 at 04:09 UTC
    wouldn't this be a great place to use "do"
    sub do_weather { do '/home/system/weather/wx.pl'; }
    ?? I don't know, just asking.
      And, to more perl-ish, there's the pretty snazzy Mail::Audit out there on CPAN to replace procmail/filter etc. I say filter as that's what I replaced, I've not got procmail so it may be wrong, thought the article in tpj describing Mail::Audit describes it as such. a
RE: RE: K-Mart Blue Light E-mail Auto-responder
by Anonymous Monk on Aug 20, 2000 at 04:09 UTC
    wouldn't this be a great place to use "do" <CODE> sub do_weather { do '/home/system/weather/wx.pl'; } ?? I don't know, just asking.