also, while we're at it, whenever you find yourself doing a whole bunch of print statements I like to use what's called a unix 'here document'. (google it).

So that something like this:

print " $0 -l <log_file> -u <userlist_file> -r <report_file>\n\n" +; print " -l <log_file> The relative or absolute path t +o the webserver logfile.\n" ; print " -u <userlist_file> The relative or absolute path t +o the user list file.\n" ; print " -r <report_file> The relative or absolute path t +o the generated report file.\n\n" ;

looks like this:

print <<EOUsage; $0 -l <log_file> -u <userlist_file> -r <report_file> -l <log_file> The relative or absolute path to the webse +rver logfile. -u <userlist_file> The relative or absolute path to the user +list file. -r <report_file> The relative or absolute path to the gener +ated report file. EOUsage

You don't have to worry about sticking in '\n's wherever and no need to backslash protect a lot of special characters, you can stick your variables in it, and you can see what your output will look like because it is exactly as you typed it... like magic.

Ain't perl cool? :) Good luck, --Ray


In reply to Re^2: Script Help! by raybies
in thread Script Help! by blackice69

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.