#!"C:\Documents and Settings\nau6342\Desktop\xampp\perl\bin\perl.exe" use CGI qw(:standard); use strict; use warnings; use Fcntl ':flock'; # import LOCK_* constants my $username = param("username"); open(OUTFILE, ">$username.txt") or die("The file: $username.txt could not be opened: $!"); flock(OUTFILE,LOCK_EX); # Lock the file for writing my($password, $fname, $lname, $address, $city, $state, $phone, $dob) = (param("pwd"), param("firstname"), param("lastname"), param("street"), param("city"), param("state"), param("phone"), param("birthday")); print OUTFILE "$username\n$password\n$fname\n$lname\n$address\n$city\n$state\n$phone\n$dob"; # Write to the file flock(OUTFILE,LOCK_UN); # Unlock the file close(OUTFILE);