Can be simplified, but it works....open (FILE,"<file") || die "Could not open file : $!\n"; @contents = <FILE>; $head = shift(@contents); close(FILE); $new_entry = 'Welcome to www.perlmonks.org'; open (FILE, ">file") || die "Could not open file : $!\n"; unshift (@contents,$head,$new_entry); print FILE "@contents\n"; close(FILE);
In reply to Re: begining of a file
by s0ttle
in thread begining of a file
by sOKOle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |