How do I insert a line in a file to the beginning of a file in Perl? -
i used perl helper code this. looks missing character or something. need write new text top of text file.
open (logfile, ">> complete.txt") ; # writes new bottom $datetime = localtime ; print logfile "\n" ; print logfile $datetime\n" ; print logfile "$name\n" ; print logfile "has completed work\n" ; close (logfile) ;
this answered in perl faq.
how change, delete, or insert line in file, or append beginning of file?
if you're programming in perl, it's worth taking hour or skim faq. it's full of useful information.
Comments
Post a Comment