Condition.pm (automake-1.16.2.tar.xz) | : | Condition.pm (automake-1.16.3.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | # GNU General Public License for more details. | |||
# You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | |||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | # along with this program. If not, see <https://www.gnu.org/licenses/>. | |||
package Automake::Condition; | package Automake::Condition; | |||
use 5.006; | use 5.006; | |||
use strict; | use strict; | |||
use warnings FATAL => 'all'; | ||||
use Carp; | use Carp; | |||
use Exporter; | ||||
require Exporter; | our @ISA = qw (Exporter); | |||
use vars '@ISA', '@EXPORT_OK'; | our @EXPORT_OK = qw (TRUE FALSE reduce_and reduce_or); | |||
@ISA = qw/Exporter/; | ||||
@EXPORT_OK = qw/TRUE FALSE reduce_and reduce_or/; | ||||
=head1 NAME | =head1 NAME | |||
Automake::Condition - record a conjunction of conditionals | Automake::Condition - record a conjunction of conditionals | |||
=head1 SYNOPSIS | =head1 SYNOPSIS | |||
use Automake::Condition; | use Automake::Condition; | |||
# Create a condition to represent "COND1 and not COND2". | # Create a condition to represent "COND1 and not COND2". | |||
skipping to change at line 170 | skipping to change at line 171 | |||
my $c3 = new Automake::Condition "COND1_TRUE", "COND1_FALSE"; | my $c3 = new Automake::Condition "COND1_TRUE", "COND1_FALSE"; | |||
my $c4 = new Automake::Condition "COND2_TRUE", "FALSE"; | my $c4 = new Automake::Condition "COND2_TRUE", "FALSE"; | |||
$c3 == $c4; # True! | $c3 == $c4; # True! | |||
$c3 == FALSE; # True! | $c3 == FALSE; # True! | |||
=cut | =cut | |||
# Keys in this hash are conditional strings. Values are the | # Keys in this hash are conditional strings. Values are the | |||
# associated object conditions. This is used by 'new' to reuse | # associated object conditions. This is used by 'new' to reuse | |||
# Condition objects with identical conditionals. | # Condition objects with identical conditionals. | |||
use vars '%_condition_singletons'; | our %_condition_singletons; | |||
# Do NOT reset this hash here. It's already empty by default, | # Do NOT reset this hash here. It's already empty by default, | |||
# and any setting would otherwise occur AFTER the 'TRUE' and 'FALSE' | # and any setting would otherwise occur AFTER the 'TRUE' and 'FALSE' | |||
# constants definitions. | # constants definitions. | |||
# %_condition_singletons = (); | # %_condition_singletons = (); | |||
sub new ($;@) | sub new ($;@) | |||
{ | { | |||
my ($class, @conds) = @_; | my ($class, @conds) = @_; | |||
my $self = { | my $self = { | |||
hash => {}, | hash => {}, | |||
End of changes. 4 change blocks. | ||||
5 lines changed or deleted | 6 lines changed or added |