Couple more points apart from those already mentioned:

  1. Where you have
     if ($opts{h} || $opts{u})  { exec "perldoc $0" };
    
    you might want to check out the Pod::Usage module. For example (copied straight from the docs)
     use Pod::Usage;
     use Getopt::Long;
     ## Parse options
     GetOptions("help", "man", "flag1") || pod2usage(-verbose => 0);
     pod2usage(-verbose => 1)  if ($opt_help);
     pod2usage(-verbose => 2)  if ($opt_man);
     pod2usage(-verbose => 2, -message => "$0: $error_msg.\n")
         if $some_error
    
    The neat thing about this module, is that it can handle your 'usage' message (runrig), or display a full man page without you having to do it your self, or setting off an exec to do it for you.

  2. You having the following
     if ($opts{f})             { $conf = $opts{f} };        
     # if no conf file specified, use "/etc/errreporter.conf as
     # the default ...
     unless ($conf) { $conf = "/etc/errreporter.conf" 
    
    Simpler (or at least more idiomatic) may be
     $conf = $opts{f} if exists $opts{f};
     $conf ||= "/etc/errreporter.conf";
    
    or even
     $conf = $opts{f} || "/etc/errreporter.conf";
    
    Mind out for the gotcha though... $conf will get set to the default if $opts{f} doesn't exist, isn't defined, or if it is just logically false (0 or empty string)

  3. You might want to load your config file using require. Its a lot safer, more robust, more portable and just plain easier

  4. You seem to be fond of using regexps for testing string equality:
     if ($identifier =~ /$_/)...
     if ($ignore =~ /yes/)...
    
    What's wrong with plain old
     if ($ignore eq 'yes')...
    
    That's what 'eq' is for

Good luck with it :)

Update corrected $ignore eq /yes/ to $ignore eq 'yes'. Thanks chipmunk for pointing that out... it was a typo... honest!


In reply to Re: stop me from embarrassing myself by Tyke
in thread stop me from embarrassing myself by blueflashlight

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.