This is the way I would do it, however my code has been subject to criticism
more that once in the past :)

open (FILE, "<myfile.dat") or die;
@file = <FILE>;
close (FILE);
$new_data = "This is my new line that I am going to put at the top\n";
unshift (@file, $new_data);
open (FILE, ">myfile.dat") or die;
print FILE @file;
close (FILE);

-----Original Message-----
From: NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED]
Sent: Friday, October 29, 2004 9:34 AM
To: Mandar Rahurkar; Rajesh Dorairajan; [EMAIL PROTECTED]
Subject: RE: Append on top




> -----Original Message-----
> From: Mandar Rahurkar [mailto:[EMAIL PROTECTED] 
> Sent: Friday, October 29, 2004 3:18 PM
> To: Rajesh Dorairajan; Perl-Beginners ([EMAIL PROTECTED])
> Subject: Re: Append on top
> 
> 
> read the file. Rewrite ur data into the file followed by 
> original data. easy way..
> 

I'm not convinced this approach will do the job.
Please send an excerpt code ...

José.


**** DISCLAIMER ****

"This e-mail and any attachment thereto may contain information which is
confidential and/or protected by intellectual property rights and are
intended for the sole use of the recipient(s) named above. This email is not
intended to create or affect any contractual arrangements between the
parties.
Any use of the information contained herein (including, but not limited to,
total or partial reproduction, communication or distribution in any form) by
other persons than the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either
by telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our
website at http://www.proximus.be or refer to any Proximus agent.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to