The $log .= "..." appends the string to $log each time through the loop so at the end, it's one large string.my $log = ""; for my $item (@stuff) { do_something($item); $log .= "Email sent to: $item<br>\n"; } print $log_file $log;
In reply to Re: Updating variable in a loop
by Paladin
in thread Updating variable in a loop
by htmanning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |