> > > Did you find a way to set the filename to "temp_file.lock"? The OP has > > obviously RTFM. > > Is no problem now with: > open LOCK_FH , ">$file_name" or die "cannot create hanlde!\n"; > . > . > . > close LOCK_FH; > > unlink ( $file_name ) or warn "cannot delete !\n"; > > I can do what I want to do. I just thought that tempfile can do all this in > one step. As you sayed, my file has the purpose to lock other instances of > the perl-script so only one can run at a time. >
This is where the disconnect is. The concept behind 'tempfile' is that it will produce a *guaranteed* different file or unique file each time, which is precisely why it was written. You are looking for a locking solution (which granted the lock is a temp file but not of the same sort). There is: LockFile::Simple (haven't used it personally) perldoc -q lock perldoc -f flock http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>