in reply to Opening the same file over and over. Shorter way to do this?

I would use one temporary file, which needs not be locked, and then simply move the temporary file over to the old file. The only time you need to lock/unlock is when you are reading from the original file, and the only time you might encounter this lock is when you move the file over. Here's an example bit of code, but you'll have to fill in the blanks...
sub add { open FH, "<$file" or die $!; &lock( *FH ); $/ = "\;\n\n"; my @array = <FH>; &unlock( *FH ); close FH; push @array, $my_long_domain_string_you_have; @array = sort @array; my $tempfile = "$file." . time(); # Unique id open FH, ">$tempfile" or die $!; &lock ( *FH ); print FH @array; &unlock( *FH ); close FH; # rename $file, "$file.old" or die $!; #Backup if desired rename $tempfile, $file or die $!; }

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain