Write at the beginning of a file

A

Alain Star

Hello!

Can anyone tell me how to write a block of text at the beginning of a file
instead of appending it as in the following example? Thanks. AS

my $fh = new FileHandle;
$fh->open(">> $fileName");
print $fh "$body";
print $fh "\n\n";
$fh->close;
 
J

Jürgen Exner

Alain said:
Can anyone tell me how to write a block of text at the beginning of a
file instead of appending it as in the following example? Thanks. AS

Your Question is Asked Frequently: perldoc -q "append to the beginning of a
file"

jue
 
A

Alain Star

Jürgen Exner wrote:
:: Alain Star wrote:
::: Can anyone tell me how to write a block of text at the beginning of
::: a file instead of appending it as in the following example? Thanks.
::: AS
::
:: Your Question is Asked Frequently: perldoc -q "append to the
:: beginning of a file"


Mea Culpa.

Thanks.

AS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,144
Latest member
KetoBaseReviews
Top