[bug#60807] [PATCH v2] tests: reuse am_cv_filesystem_timestamp_resolution

Jacob Bachmeyer <[email protected]> Mon, 16 Jan 2023 20:18:16 -0600
Newsgroups gmane.comp.sysutils.automake.patches
Message-ID <[email protected]>
Mike Frysinger wrote:
> On 14 Jan 2023 21:43, Jacob Bachmeyer wrote:
>   
> [...]
>> You could also exploit that || short-circuits in the shell and replace 
>> the "if" block with " $PERL ... || sleep='sleep ''2' ".  This allows you 
>> to directly execute a command on a false result and (I think) it is 
>> portable, too.  (I half-expect someone to correct me on that along the 
>> lines of "the shell on Obscurix has a bug where || implicitly uses a 
>> subshell".)
>>     
>
> personally i find (ab)use of `||` and `&&` tends to lead to unmaintainable code.
> i.e. it tends to produce write-once-read-never code akin to most perl.  so if
> the construct has been in use already and isn't causing issues, i'd use it.

In Perl at least, use of the "word forms" of those operators for flow 
control is considered idiomatic Perl, most often seen in the form "open 
... or die ...;" and indeed in another of your patches as "stat ... or 
fatal ...".  :-)


-- Jacob