Gossamer Forum
Home : General : Perl Programming :

Is there any other way?

Quote Reply
Is there any other way?
Ok,

I could use push but I dont want to. Grep is too slow. Is there a way to modify one line of a database file and keep the line in teh same place?


Tahnks,
Vivitron
Quote Reply
Re: Is there any other way? In reply to
You mean a flat-file database?

adam
Quote Reply
Re: Is there any other way? In reply to
Yes...

ie $id,$email, $name, $url, $emailperson, $subject, $date, $ip, $replies, $thread
Quote Reply
Re: Is there any other way? In reply to
Well, I haven't got to grep yet, so I guess that you're probably more advanced than me, but couldn't you just read the file into an array and check each line for a match? If it doesn't match, add it to a new variable. If it does, modify it and then add it to the variable. Wouldn't that leave the line in the same place?

adam
Quote Reply
Re: Is there any other way? In reply to
Yeah, I had that idea. I think I will use push after all.

Thanks for your help!