On Sun, 2006-23-04 at 17:07 -0400, Smith, Derek wrote:
> This does not work as my file still contains both lines.
> check-names warn;
> fooy
> 
> when I want it to only contain
> fooy

That's not what truncate does. It chops off the end of the file. What
you have to do is copy the contents to a temporary file until you get to
the point you want, close the file, and move (see `perldoc File::Copy`)
the temporary file to the permanent one.


-- 
__END__

Just my 0.00000002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/



-- 
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