I have a database file with fields delimited by double semicolons (;;). I am working on a script that will use HTML forms to allow a user to edit records within the file. The file is fed into an array line-by-line, with each element of the array holding a single field from the current record. Here's the code: while ($line = <datafile> ) { @array = split (/;;/, $line); *work with each record* }

The file has a specific order that needs to be maintained.

So, here are my questions. First, is there a way to read though the file, and when specific conditions are met (i.e. the correct record is found), overwrite a portion of the record, then continue reading the file. Something like this: while ($line = <datafile> ) { @array = split (/;;/, $line); if ($array[3] eq "yes") { $array[3] = "no"; write to file new value for $array[3] } } now continue reading file

My second question is this: The user uses an HTML for to locate the record they want to delete. Search the file for that record: while ($line = <datafile> ) { @array = split (/;;/, $line); if ($array[0] eq *selected record ID*) { *delete record* } } continue reading the file