Not an expert in perl (nor in english), but let's try ;-)
if your output file is not supposed to get too big,
consider 'writing' first your output lines in a hash
... $hash{1} = "line 1"; and so on
(later, writing line 10 for eg.)
if (whatever)
{
$hash{5} .= " these few words";
}
when finished, drop all the lines in the hash
to output file
... foreach (sort(keys(%hash))
{
print OUTPUTFILE $hash{$_}, "\n";
}
Hope this helps.
Hello Buddy a �crit :
>
> Hi Perl experts,
> I need your help. I am absolute Perl beginner.
> I am writing perl with Windows 95 machine. I download
> Perl from activestate and my version 5.6.1. It works
> properly and I can run some program.
> Currently I am writing log file processing with
> perl. I can write normal program as read the log file
> and write to formatted log file. What I am facing now
> is when I write to format text file, suppose I was
> currently in line 10 for my formatted text file and I
> want to append some word in line 5 of formatted text
> file. I want to know how to do it. Which function
> should I use. I use seek() function to write but it
> add additional machine words.
> Thanks in advance for your help.
>
> Best regards,
> Winn Thu
> Myanmar
>
> __________________________________________________
> Do you Yahoo!?
> Faith Hill - Exclusive Performances, Videos & More
> http://faith.yahoo.com
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]