Rory Oconnor wrote:
>
> I need to touch a file with a "1" in it if a condition is true, and
> either toggle the "1" to a "0" or delete the file (whichever is better,
> probably toggle) if another condition is true. Excuse my
> newbie-ness...but can anyone give me some hints as to the correct syntax
> for that?
if ( $condition_is_true && !-e $file ) {
open FLAG, "> $file" or die "Cannot create $file: $!";
close FLAG;
# process stuff here
}
elsif ( $another_condition_is_true && -e $file ) {
unlink $file or die "Cannot delete $file: $!";
# process stuff here
}
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]