I have the following piece of code:
#!/usr/bin/perl -w use strict; my $NONFATALERROR = 0;
snip...
############################################ # build a master file of daily backup jobs # ############################################ open LIST, ">", "/tmp/backupjobs/${SESSION}.ksh" or { print MASTERLOG $TIMEIS->() . " > Unable to build masterlist /tm +p/backupjobs/${SESSION}.ksh\n"; ########################### # Set nonfatal error to 1 # ########################### $NONFATALERROR = 1; }; if ( ! $NONFATALERROR == 0 ) { print LIST "$_\n" for (@BACKUP_SCRIPTS); close LIST; print MASTERLOG $TIMEIS->() . " > List /tmp/backupjobs/${SESSION}. +ksh has been built\n"; }
which yeilds the follwoing error
syntax error at ./newbackup.pl line 179, near "$NONFATALERROR " Execution of ./newbackup.pl aborted due to compilation errors.
line 179 is $NONFATALERROR = 1;

what Im looking to do circumvent fatal errors by not running the code below it. Like an exception in OO. Is this possible to do w/o extra modules? Id like this code to be as uncomplicated as possible, because of the skill level of those who may be maintaining it.

Thanks
Ted
--
"That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved."
  --Ralph Waldo Emerson

In reply to anonymous code blocks by tcf03

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.