in reply to Re: Re: Re: substitution in $0in thread substitution in $0
open (PROG, "+>>$0"); seek (PROG, 0, 0); #I don't know why but it's NECESSARY! [download]
Because >> moves the file position to end-of-file.