Hi
I'm trying to get a random line from a text file and than delete the file.
I came up with this and it works, however the line which was cut/past adds 
without any reason a backspace/space on it. It doesn't write it all on one 
line. How can I change the script that it doesn't add anything on it. Must 
I add a start/end to the txt file?
Please can somebody help me
Daniel

$random_file = "/home/sites/site70/web/cgi-bin/i-merchant/admin/setup/ric.txt";

open (FILE, $random_file);
@LINES=<FILE>;
close(FILE);
srand;

$OTP = "$LINES[int rand(@LINES)]";

$PWFILE = $OTP;
open (FILENEW, ">$random_file");
foreach $LINES (@LINES)
        {
if ($PWFILE eq $LINES){
$LINES = ""
}
else
{
print FILENEW $LINES;
}

        }

close (FILENEW);


thanks for any help
Daniel



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to