First, allow me to complement you for reading the site FAQs, and using the <code></code> tags.

I'd probably start by creating an array to hold the values you're searching for, and using a for loop to check for each of those values. That way, adding new ports becomes pretty simple. It's not *the* most efficient way, but your script is hardly going to take a server to it's knees. And we're told that maintainability is worth more than a little performance hit.

For checking for file size, use the '-s' operator. This returns the size of the requested file. '-z' will tell you if the file is zero-length or not. 'perldoc -f -s' will tell you about these.

For mailing the results, check out the Mail::Mailer module. This will allow you to easily send mail. There are actually a couple of modules for sending e-mail. Some will argue that some are better than others, for whatever reasons. This one would be a good place to start, and you can poke around in the Mail:: and Net:: area on CPAN for other modules.

--Chris

e-mail jcwren

In reply to (jcwren) Re: I want to be a Perl Jedi by jcwren
in thread I want to be a Perl Jedi by dru145

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.