Bukowski has asked for the wisdom of the Perl Monks concerning the following question:
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 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...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 }
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Remembering values from multiple condition 'if'
by broquaint (Abbot) on Jul 01, 2002 at 17:44 UTC | |
Re: Remembering values from multiple condition 'if'
by Corion (Patriarch) on Jul 01, 2002 at 17:46 UTC | |
Re: Remembering values from multiple condition 'if'
by lestrrat (Deacon) on Jul 01, 2002 at 17:44 UTC | |
by merlyn (Sage) on Jul 02, 2002 at 14:15 UTC | |
Re: Remembering values from multiple condition 'if'
by TheHobbit (Pilgrim) on Jul 01, 2002 at 21:40 UTC | |
by Aristotle (Chancellor) on Jul 02, 2002 at 01:51 UTC | |
by TheHobbit (Pilgrim) on Jul 02, 2002 at 19:53 UTC | |
by Aristotle (Chancellor) on Jul 02, 2002 at 19:58 UTC |