Dan,
Just figured it out...
my $backup = #Dir in hash somewhere. Not important....
-T $backup || open(BACKUP, ">/tmp/passwd_backup");
Very, very cool!
Cheers,
Dan
Hi all,
I want my perl code to be able to check to see if a file exist and if
the file doesn't exist I want that file to be created. What would be my
best way of going about this?
Something like...
$backup_file = $conhash{$title}{'Linux Passwd Backup'}; #Grab location
from a directory located in a hash.
next if (exists($backup_file)) {}
else {
open(BACKUP, ">backup_file") #Create file backup_file;
#%conhash looks like this...
%conhash = (
{
Backup => /tmp/backup_file
},
);
Can any one add or correct this?
Regards,
Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]