Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Updating variable in a loop

by Paladin (Vicar)
on Jun 07, 2016 at 21:54 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1165115]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-26 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found