Leon,
I've tested reading and writing from the same file and it didn't work. I
think that can't be done in any language.
Leon wrote:
> ----- Original Message -----
> From: "Ahmed Moustafa" <[EMAIL PROTECTED]>
> Newsgroups: perl.beginners
> To: "Leon" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
>
>>Can you open a file for reading and writing as the same time?
>>
>
> I have asked the question of can I read and write to the same file
> simultaneously, such as this :-
> open FILE, 'myfile.txt' or die "$!\n";
> open FILE2, '>myfile.txt' or die "$!\n";
> while (<FILE>){
> # do some changes to $_;
> print FILE2 $_;
> };
>
> but I did not get any response. Therefore I dont think we can do that.
>
> ---- end of msg -----
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]