I want to add a line to top and bottom of the file. I can do it following way.
open (DATA, \"
you can do this
open(FILE,">", $file) or die "cannot open $file: $!"; print FILE "add line to top\n"; while () { print $_ ."\n";} close(FILE); print FILE "add line to bottom\n";
on command line
perl myscript.pl > newfile