in reply to Re^2: Script replaces instead of add
in thread Script replaces instead of add

Alternative to my previous reply, if you don't want to "dive into" Perl Data Structures:

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:
$delaylist{ $_ } .= $msg . "\n";
In listdelays:
foreach (@nicks) { print "--> \cB$_\cB:\n"; print "$_\n" for split /\n/, $delaylist{ $_ }; }
and finally, in delayer:
print ("query $nick $_") for split /\n/, $delaylist{$nick};
Luckily, split omits trailing empty fields, otherwise the code in adddelays would have to be more complicated. Thanks perl for autovivification and DWIM :-)