Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Updating variable in a loop

by Paladin (Vicar)
on Jun 07, 2016 at 21:54 UTC ( #1165115=note: print w/replies, xml ) Need Help??


in reply to Updating variable in a loop

You can use something like the following to construct one large string:
my $log = ""; for my $item (@stuff) { do_something($item); $log .= "Email sent to: $item<br>\n"; } print $log_file $log;
The  $log .= "..." appends the string to $log each time through the loop so at the end, it's one large string.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1165115]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2019-10-22 09:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?