in reply to Re^2: Script replaces instead of add
in thread Script replaces instead of add
The problem statement turns into: "how to represent multiple messages?"
The most flexible is: as an array of individual messages. However, if you are certain there won't be, e.g., newlines in your messages, you can use that as a delimiter. That would make: In adddelays:In listdelays:$delaylist{ $_ } .= $msg . "\n";
and finally, in delayer:foreach (@nicks) { print "--> \cB$_\cB:\n"; print "$_\n" for split /\n/, $delaylist{ $_ }; }
Luckily, split omits trailing empty fields, otherwise the code in adddelays would have to be more complicated. Thanks perl for autovivification and DWIM :-)print ("query $nick $_") for split /\n/, $delaylist{$nick};
|
|---|