D
D
DimDimuch2018-05-23 15:17:33
Perl
DimDimuch, 2018-05-23 15:17:33

How to add text to the beginning of a line?

Please help
How can I add Privet to an existing tmp.txt file that has a line?
The code must be written in the Perl script itself, and not a call from the command line

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
arto, 2018-06-01
@artopp

open F, "+<", "tmp.txt";
$a = do { local $/; };
seek F, 0, 0;
print F "Privet\n", $a;
close F;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question