if ( -f $working_file ) {
open WORKINGFILE, "<$working_file" or die $!;
while (<WORKINGFILE>) {
$line = $_;
#@storelist - I am getting this thru a sql statement
foreach $temp (@storelist) {
chomp $temp;
($x,$store,$distri,$end_date)=split(';',$temp);
chomp $store,$distri,$end_date;
# print LOG "The store in the lookup is $store and the distributor is $distri\n";
if ( "$store" ne "" && "$end_date" eq "" ) {
if ( substr($_,0,4) =~ "$store" ) {
open NEWFILE,">>$temp_dir$next_file" or warn $!;
print NEWFILE $_;
# delete $_ from $working_file ?????????? HOW ????
}
}
}
My question is that if the $store is matched with data in the working file, then I am writing a NEWFILE(this works great), but also, I need to delete the same line from the $working_file. How do I do that?
thx