in reply to Checking whether a value is between two limits: Useless use of private variable in void context

Note B::Deparse can be a useful tool:

$ perl -MO=Deparse -we 'use strict; my $value=1; my $lower_limit = 0; my $upper_limit = 2; if ( ( $value <= $upper_limit ) && ( $value => $lower_limit ) ) { print "the value is in the range!\n"}' Useless use of private variable in void context at -e line 4. BEGIN { $^W = 1; } use strict; my $value = 1; my $lower_limit = 0; my $upper_limit = 2; if ($value <= $upper_limit and $value, $lower_limit) { print "the value is in the range!\n"; } -e syntax OK

Say perl -MO=Deparse,-p ... to add parentheses and see the precedence better.

  • Comment on Re: Checking whether a value is between two limits: Useless use of private variable in void context
  • Select or Download Code