
japhy
Enthusiast
Mar 21, 2001, 10:40 AM
Post #5 of 8
(479 views)
|
|
Re: add line in the top of the file
[In reply to]
|
Can't Post
|
|
The following code, FROM THE FAQ, works for me:
{ local $^I = '.bak'; local @ARGV = "filename"; while (<>) { print $new_stuff if $. == 1; # EDIT print; # forgot this line -- this prints the original line } } Done. Jeff "japhy" Pinyan -- accomplished hacker, teacher, lecturer, and author
(This post was edited by japhy on Mar 21, 2001, 10:32 AM)
|