Follow-up Comment #8, bug #68793 (group groff):
At 2026-10-21T22:43:56-0400, Dave wrote:
> Follow-up Comment #7, bug #68793 (group groff):
>
> [comment #4 comment #4:]
>
>> my $TMPDIR=exists($ENV{TMPDIR})?$ENV{TMPDIR}:'.';
>
>
>> This is perl's ternary operator - test ? value if true : value if
>> false. So $TMPDIR is set to $ENV{TMPDIR} if it exists else '.'.
>
> For environment variables, I use this simpler syntax to accomplish the
> above:
>
> $TMPDIR = $ENV{TMPDIR} // '.';
>
> The // operator tests for definedness rather than existence, but I
> don't know of a way a value of @ENV might be undef (unless the Perl
> code itself sets it so), so it effectively works out to the same test.
Perl's `//` operator came in with 5.10 (a mere 19 years ago, still got
that showroom shine). For now, we still use Perl 5.8 as our minimum
supported version, up from 5.6 as of groff 1.24.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68793>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
