First things first. You'll have to explain to us why we're trying to reinvent the wheel with functions like "FileExists"...
if( ( $statusLoadmsg = &FileExists( $logFile ) ) == $FALSE ) { &ResCode("WARNING"); &BrowseCode("File \"$logFile\" not found"); 
 &SummaryCode("WARNING"); return $WARNING; }
Maybe...
do {warn "$logfile not found"; return $warning} unless -e $logfile;
would do?
# # read whole log file # if( &readFileContents( $logFile, $ContentsLoadMsg ) == $FALSE ) { &ResCode("E_LOADMSG_ERROR"); : &BrowseCode("Could not open \"$logFile\""); 
 &SummaryCode("E_MISLOAD_ERROR"); return $FALSE; }
...Hmm, is "readFileContents" any different than $contents = <$logfile>;(with $/=undef)? Then of course we have to ask why bother with the exsistance check in the first place. Oh, and what's up with all the $TRUE and $FALSE. Looks ugly and error prone to me. And by the description in the update, I'd guess you should be able to do what you want in less than 10 lines of code.

In reply to Re: Code refactoring challenge by Anonymous Monk
in thread Code refactoring challenge by castaway

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.