best regards,#!/usr/bin/perl use strict; use warnings; use Tie::File; my $file = "file.txt"; my $insert = shift @ARGV; chomp $insert; my @lines; tie @lines, 'Tie::File', $file or die $!; unshift @lines, $insert; # more simple, isn't it? untie @lines;
In reply to Re: Re: writing to the top of a file
by neniro
in thread writing to the top of a file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |