A few months back I wrote a command-line program running on a Win box with ActiveState's perl that does the following --
  1. it runs in a "while (1) {}" loop forever, with a "sleep 300" in it until ctrl-c-ed;
  2. every 5 mins the program queries an email account on an Exchange Server and checks for messages;
  3. if any messages are found, it extracts certain information from those messages using regexp;
  4. the extracted information is inserted in various tables in a SQL Server db;
  5. new emails are created based on the extracted information, forwarded to certain addresses;
  6. the messages are moved to another mail folder for archiving, and a log is written out.
I used Mail::IMAPClient, Mail::Sendmail, HTML::Parser, and DBI.

I am now ready to write the next version of my program, and, thus, I seek the following advice (I will be re-writing my code as a more OO code -- I've recently been learning OO techniques, and I believe this program could benefit from such an approach) --

Should I use the new Email::Simple modules instead of the above-mentioned Mail modules (I found the Mail modules to be a bit complicated, and somewhat unreliable in conjunction with Exchange Server)?

And, more imporantly, how could I go about converting my program to give a more sophisticated "appearance"? In particular, I would like to convert the program so that it runs as a Windows service (I tried doing that, and while I was able to create a service, the darn thing never ran) or a *nix daemon; and I would like to provide an interface to start, stop, and minimally configure the program (like, provide the sleep time, email account and email server names and passwords, view log files, etc.). A web-interface would be great because it could be controlled from anywhere, and would be platform-independent.

All advice will be much appreciated.

Update: its the "interface" part that I am most eager to implement in this new version -- some easy, clickety-click way to allow the "admin" of this program to set config params, start and stop, and load and read the log files.


In reply to converting a command-line program to one with a "pretty" interface by punkish

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.