T
Todd Anderson
Hello,
Because my host times out a script after 60 seconds, I created a cronjob
that prompts my script every minute. When started it counts the number
of lines in a flat file divides it by 10 to determine how many times it
will take to finish the billing ($number_of_sends). Then each time it's
prompted it processes 10 lines at a time ie: @billingnumber =
(351..360); and deducts the $number_of_sends by 1 for the next prompt.
This all works fine but I can't quite figure out how to get it to
recognize the 10 lines to process. Below is what I have. It is working
but it's also multiplying every line by 10.
Thanks in advance for any help.
(please NO rectal discharge)
$e_number = "0";
open (USERS, "$file") || billerror
("$file Billing Notice" );
flock(USERS, 2);
while (<USERS>)
{
$line = $_;
chomp $line;
@fields = split (/\|/, $line);
$e_number++;
foreach $billingnumber (@billingnumber){
if ($billingnumber eq "$e_number"){
#do a bunch of stuff to these lines
}#e_number
else{ $hold_row .="$line\n"; }
}#@billingnumber
}#while
flock(USERS, 8);
close (USERS);
Because my host times out a script after 60 seconds, I created a cronjob
that prompts my script every minute. When started it counts the number
of lines in a flat file divides it by 10 to determine how many times it
will take to finish the billing ($number_of_sends). Then each time it's
prompted it processes 10 lines at a time ie: @billingnumber =
(351..360); and deducts the $number_of_sends by 1 for the next prompt.
This all works fine but I can't quite figure out how to get it to
recognize the 10 lines to process. Below is what I have. It is working
but it's also multiplying every line by 10.
Thanks in advance for any help.
(please NO rectal discharge)
$e_number = "0";
open (USERS, "$file") || billerror
("$file Billing Notice" );
flock(USERS, 2);
while (<USERS>)
{
$line = $_;
chomp $line;
@fields = split (/\|/, $line);
$e_number++;
foreach $billingnumber (@billingnumber){
if ($billingnumber eq "$e_number"){
#do a bunch of stuff to these lines
}#e_number
else{ $hold_row .="$line\n"; }
}#@billingnumber
}#while
flock(USERS, 8);
close (USERS);