Re: [PATCH RFC 08/10] send-email: Add --sleep for email throttling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Apr 11, 2009 at 21:27, Jay Soffian <jaysoffian@xxxxxxxxx> wrote:
> On Sat, Apr 11, 2009 at 3:08 PM, Michael Witten <mfwitten@xxxxxxxxx> wrote:
>> +if (defined $sleep) {{
>> +}}
>
> What's the double-brackets about?

The {} that form the true-body of the if statement don't actually
denote a block. The extra layer of {} is explicitly creating a block.
This is done, because in Perl, blocks can be thought of as loops that
execute one iteration, so you can use all of the loop flow-control
operators 'redo', 'last', and 'next'.

In this case, I wanted to use 'last' to jump out of --sleep setup
should the user decide to do so, because I think it's cleaner than a
goto or variable check or superfluous loop:

if (defined $sleep) {{

	unless ($chain_reply_to) {
		...
		/^b/                                               or
		/^s/ and $chain_reply_to = 1                       or
		/^c/ and $sleep = undef, last                      or  # forget --sleep was ever used
		/^n/ and $chain_reply_to = 1, $sleep = undef, last or  # forget --sleep was ever used
		/^q/ and exit;
	}
	...
}}
# last jumps to here

Anyway, this particular behavior was requested (and seems reasonable):

	http://marc.info/?l=git&m=123929919621279&w=2

Sincerely,
Michael Witten

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]