Home: Perl Programming Help: Advanced:
File HANDEL Problem



webhay
Novice

Oct 8, 2000, 5:14 AM


Views: 2292
File HANDEL Problem

I want to Delete record from my data.
When i Try to open file for write "Open(HANDEL,">$filename");"
the program Overwrit my file And lost my data

Thanks
haytham


------------------
Haytham Taher


perlkid
stranger

Oct 8, 2000, 1:32 PM


Views: 2292
Re: File HANDEL Problem

 
Change ">" to "<"

> means to overwrite to the file.

>> to append to the end of the file

< to read from the file

perlkid


dws
Deleted

Oct 8, 2000, 8:24 PM


Views: 2292
Re: File HANDEL Problem

If you're trying to delete a record (line?) by rewriting the file in place, none of the above advice will work. Go back to the docs and re-read open().

perldoc -f open

will give the the info you're looking for.