Hello gracious PerlMonks,

I have a short question, its perplexing me but its the end of the day and I am decaffeinated...

Let us say I have a series of filetests in an 'if' statement like this:

if (-e "$f" || -e "$a" || -e "$scratchfile" || -e "$fasta_output") { print "Files belonging to a previous version exist\n"; #delete old files somehow }else{ #continue with analysis }
If one, or more, of those files exists, how can I delete them by directly referencing the results of the 'if' statement, rather than writing 4 separate 'unlink's for each of the conditions tested? I am sure there is a more elegant way to do it than the way I will do it if I carry on uneducated...

Many thanks, in advance,

Bukowski - aka Dan (dcs@black.hole-in-the.net)
"Coffee for the mind, Pizza for the body, Sushi for the soul" -Userfriendly


In reply to Remembering values from multiple condition 'if' by Bukowski

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.