+#######################################################################
+# set_worksheet_line($ws_global, $startrow, $startcol, \@content, $format);
+#
+# set values to a sequence of cells in a row.
+#
+#######################################################################
+sub set_worksheet_line {
+ my ($worksheet, $row, $col, $content, $format) = @_;
+
+ foreach my $token (@$content)
+ {
+ $worksheet->write($row, $col++, $token, $format );
+ }
+
+}
+
+#######################################################################
+# @rcpt_times = parse_time_list($string);
+#
+# Parse a comma seperated list of time values in seconds given by
+# the user and fill an array.
+#
+# Return a default list if $string is undefined.
+# Return () if $string eq '0'.
+#######################################################################
+sub parse_time_list {
+ my($string) = @_;
+ if (! defined $string) {
+ return(60, 5*60, 15*60, 30*60, 60*60, 3*60*60, 6*60*60, 12*60*60, 24*60*60);
+ }
+ my(@times) = split(/,/, $string);
+ foreach my $q (@times) { $q = eval($q) + 0 }
+ @times = sort { $a <=> $b } @times;
+ @times = () if ($#times == 0 && $times[0] == 0);
+ return(@times);
+}
+
+
+#######################################################################
+# initialise_rcpt_times($protocol);
+# Initialise an array of rcpt_times to 0 for the specified protocol.
+#######################################################################
+sub initialise_rcpt_times {
+ my($protocol) = @_;
+ for (my $i = 0; $i <= $#rcpt_times; ++$i) {
+ $rcpt_times_bin{$protocol}[$i] = 0;
+ }
+ $rcpt_times_overflow{$protocol} = 0;
+}