develooper Front page | perl.perl5.porters | Postings from April 2020

Re: chained comparisons

Thread Previous | Thread Next
David Nicol
April 8, 2020 16:12
Re: chained comparisons
Message ID:
so document this and recommend making local copies of the fetched values
from expensive tied variables, at least for now

my $middleval = $tiedthing;
if ($lowerbound < $middleval < $upperval) { ...

. All users see is that a tied variable is being evaluated twice.

"I know Darth Vader's really got you annoyed
 but remember if you kill him then you'll be unemployed" -- Alfred M.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About