At 09:10 AM 12/5/2001 +0800, louie miranda wrote:
> open(INFO, $file);
$file has a value, right?
Add this:
open(OUTFILE, ">>$append") or die "Can't open
file:$!\n"; #this is assuming you've assigned a file name to $append
> @lines = <INFO>;
> close(INFO);
> for ($a = 0; $a < $#lines; $a++) {
> if ($lines[$a] =~ /Nov 4/)
> {
> print "$lines[$a]";
> print "$lines[$a] >> $append";
> } else {
The above might work, but it might be easier to just do the following: ##
NOTE: This is UNTESTED
while ($lines = <INFO>)
{
chomp($lines)
if ($lines =~ /Nov 4/i) ## the i makes it case insensitive, so nov
4 will work as well. Nov. 4 won't, however.
{
print OUTFILE "$lines\n"; #appends to your $append file
}
else
{
}
} #end of the while statement
I hope this answers your question.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]