in reply to need help:insert a line in a textfile
There is not a single command to insert a line into a file. The Tie::File module gives a convenient way to do it.
If you wish to insert a line elsewhere, splice works with that.use Tie::File; my $newline = "whatever"; { tie my @array, 'Tie::File', '/path/to/file.txt'; unshift @array, $newline; }
After Compline,
Zaxo
|
|---|