| 1 | package DBIO::GraphQL::Policy; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: What DBIO::GraphQL exposes and who may use it (the trust model) | ||||||||||||||||||||||||||||||||||||||||||
| 3 | 14 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 14 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 14 | our $VERSION = '0.900007'; | |||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 14 | ▶ | use base 'Class::Accessor::Grouped'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 14 | ▶ | use DBIO::GraphQL::Error qw(client_error); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | # The policy is the one place that knows the trust model of a generated | ||||||||||||||||||||||||||||||||||||||||||
| 12 | # schema: which sources and columns leave the boundary, which of them a | ||||||||||||||||||||||||||||||||||||||||||
| 13 | # client may write, which sources have mutations and what the authorize | ||||||||||||||||||||||||||||||||||||||||||
| 14 | # hook says about an operation. Filter, Mutation, Relationship and | ||||||||||||||||||||||||||||||||||||||||||
| 15 | # DBIO::GraphQL itself ask it; none of them decides on its own. | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | # schema is the connected DBIO::Schema; required at construction. | ||||||||||||||||||||||||||||||||||||||||||
| 18 | 14 | __PACKAGE__->mk_group_accessors(simple => qw( | |||||||||||||||||||||||||||||||||||||||||
| 19 | schema introspection _included _mutations _hide _readonly _authorize on_error | ||||||||||||||||||||||||||||||||||||||||||
| 20 | default_rows max_rows max_in max_depth max_cost | ||||||||||||||||||||||||||||||||||||||||||
| 21 | )); | ||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 107 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=28 SCAR=33.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 107 | my ($class, %args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 25 | die "DBIO::GraphQL::Policy: 'schema' is required\n" | ||||||||||||||||||||||||||||||||||||||||||
| 26 | 107 | ▶ | unless exists $args{schema}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 107 | my $self = bless {}, $class; | |||||||||||||||||||||||||||||||||||||||||
| 28 | 107 | my $schema = $args{schema}; | |||||||||||||||||||||||||||||||||||||||||
| 29 | 107 | $self->schema($schema); | |||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | 107 | my %known = map { $_ => 1 } $schema->sources; | |||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | die "DBIO::GraphQL: 'sources' and 'except' cannot be combined\n" | ||||||||||||||||||||||||||||||||||||||||||
| 34 | 107 | ▶ | if defined $args{sources} && defined $args{except}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $args{"sources"} and defined $args{"except"}
MC/DC100%2/2
defined $args{"sources"} and defined $args{"except"}
defined $args{"sources"}
defined $args{"except"}
Truth table100%3/3
A and B
A= defined $args{"sources"}B= defined $args{"except"}
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | 106 | my @all = sort keys %known; | |||||||||||||||||||||||||||||||||||||||||
| 36 | 106 | my @included = @all; | |||||||||||||||||||||||||||||||||||||||||
| 37 | 106 | ▶ | if (defined $args{sources}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 2 | $self->_check_monikers(sources => $args{sources}, \%known); | |||||||||||||||||||||||||||||||||||||||||
| 39 | 1 | my %want = map { $_ => 1 } @{ $args{sources} }; | |||||||||||||||||||||||||||||||||||||||||
| 40 | 1 | @included = grep { $want{$_} } @all; | |||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||
| 42 | elsif (defined $args{except}) { | ||||||||||||||||||||||||||||||||||||||||||
| 43 | 1 | $self->_check_monikers(except => $args{except}, \%known); | |||||||||||||||||||||||||||||||||||||||||
| 44 | 1 | my %skip = map { $_ => 1 } @{ $args{except} }; | |||||||||||||||||||||||||||||||||||||||||
| 45 | 1 | @included = grep { !$skip{$_} } @all; | |||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||
| 47 | 105 | $self->_included({ map { $_ => 1 } @included }); | |||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | 105 | my $mutations = $args{mutations}; | |||||||||||||||||||||||||||||||||||||||||
| 50 | 105 | ▶ | if (!$mutations) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | 70 | $self->_mutations({}); | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | elsif (ref $mutations eq 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||||
| 54 | 2 | $self->_check_monikers(mutations => $mutations, $self->_included); | |||||||||||||||||||||||||||||||||||||||||
| 55 | 1 | $self->_mutations({ map { $_ => 1 } @$mutations }); | |||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||
| 57 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 58 | 33 | $self->_mutations({ %{ $self->_included } }); | |||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | 104 | for my $opt (qw(hide readonly)) { | |||||||||||||||||||||||||||||||||||||||||
| 62 | 208 | ▶ | my $map = $args{$opt} // {}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$args{$opt} // {}
MC/DC100%1/1
$args{$opt} // {}
$args{$opt}
Truth table100%2/2
A
A= $args{$opt}
| |||||||||||||||||||||||||||||||||||||||||||
| 63 | 208 | ▶ | die "DBIO::GraphQL: '$opt' must be a hashref of source => [columns]\n" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 64 | unless ref $map eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||
| 65 | 208 | my %set; | |||||||||||||||||||||||||||||||||||||||||
| 66 | 208 | for my $moniker (keys %$map) { | |||||||||||||||||||||||||||||||||||||||||
| 67 | die "DBIO::GraphQL: '$opt' names unknown source '$moniker'\n" | ||||||||||||||||||||||||||||||||||||||||||
| 68 | 3 | ▶ | unless $known{$moniker}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | die "DBIO::GraphQL: '$opt' for source '$moniker' must be an arrayref of columns\n" | ||||||||||||||||||||||||||||||||||||||||||
| 70 | 3 | ▶ | unless ref $map->{$moniker} eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 71 | 3 | my $source = $schema->source($moniker); | |||||||||||||||||||||||||||||||||||||||||
| 72 | 3 | for my $col (@{ $map->{$moniker} }) { | |||||||||||||||||||||||||||||||||||||||||
| 73 | 4 | ▶ | die "DBIO::GraphQL: '$opt' names unknown column '$col' on source '$moniker'\n" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | unless $source->has_column($col); | ||||||||||||||||||||||||||||||||||||||||||
| 75 | 4 | $set{$moniker}{$col} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||
| 78 | 208 | $self->{"_$opt"} = \%set; | |||||||||||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||
| 81 | 104 | ▶ | if (defined $args{authorize}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 82 | die "DBIO::GraphQL: 'authorize' must be a code reference\n" | ||||||||||||||||||||||||||||||||||||||||||
| 83 | 10 | ▶ | unless ref $args{authorize} eq 'CODE'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 84 | 10 | $self->_authorize($args{authorize}); | |||||||||||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | 104 | ▶ | if (defined $args{on_error}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 88 | die "DBIO::GraphQL: 'on_error' must be a code reference\n" | ||||||||||||||||||||||||||||||||||||||||||
| 89 | 10 | ▶ | unless ref $args{on_error} eq 'CODE'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | 9 | $self->on_error($args{on_error}); | |||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||
| 93 | 103 | my %limit = (default_rows => 100, max_rows => 1000, max_in => 500, | |||||||||||||||||||||||||||||||||||||||||
| 94 | max_depth => 10, max_cost => 10000); | ||||||||||||||||||||||||||||||||||||||||||
| 95 | 103 | for my $opt (sort keys %limit) { | |||||||||||||||||||||||||||||||||||||||||
| 96 | 475 | ▶ | my $value = exists $args{$opt} ? $args{$opt} : $limit{$opt}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 97 | 475 | ▶ | die "DBIO::GraphQL: '$opt' must be a positive integer\n" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
defined $value and not ref $value and $value =~ /\A[1-9][0-9]*\z/
defined $value and not ref $value
MC/DC33%1/3
defined $value and not ref $value and $value =~ /\A[1-9][0-9]*\z/
defined $value
not ref $value
$value =~ /\A[1-9][0-9]*\z/
Truth table50%2/4
A and not(B) and C
A= defined $valueB= not ref $valueC= $value =~ /\A[1-9][0-9]*\z/
| |||||||||||||||||||||||||||||||||||||||||||
| 98 | unless defined $value && !ref $value && $value =~ /\A[1-9][0-9]*\z/; | ||||||||||||||||||||||||||||||||||||||||||
| 99 | 455 | $self->$opt($value + 0); | |||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||
| 101 | 83 | ▶ | die sprintf("DBIO::GraphQL: 'default_rows' (%d) must not exceed 'max_rows' (%d)\n", | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 102 | $self->default_rows, $self->max_rows) | ||||||||||||||||||||||||||||||||||||||||||
| 103 | if $self->default_rows > $self->max_rows; | ||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||
| 105 | 81 | ▶ | $self->introspection(exists $args{introspection} ? ($args{introspection} ? 1 : 0) : 1); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||
| 107 | 81 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||
| 110 | 5 | ▶ | sub _check_monikers { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_check_monikers: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||
| 111 | 5 | my ($self, $opt, $list, $known) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 112 | 5 | ▶ | die "DBIO::GraphQL: '$opt' must be an arrayref of source names\n" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 113 | unless ref $list eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||
| 114 | 5 | for my $moniker (@$list) { | |||||||||||||||||||||||||||||||||||||||||
| 115 | die "DBIO::GraphQL: '$opt' names unknown source '$moniker'\n" | ||||||||||||||||||||||||||||||||||||||||||
| 116 | 6 | ▶ | unless $known->{$moniker}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||
| 121 | 79 | ▶ | sub monikers { sort keys %{ $_[0]->_included } } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
monikers: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||
| 124 | 94 | ▶ | sub included { $_[0]->_included->{ $_[1] } ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
included: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||
| 127 | 176 | ▶ | sub has_mutations { $_[0]->_mutations->{ $_[1] } ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_mutations: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||
| 130 | 2731 | ▶ | sub hidden { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
hidden: called CC=5 SCAR=16.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 131 | 2731 | my ($self, $moniker, $col) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 132 | 2731 | ▶ | return 1 if $self->_hide->{$moniker}{$col}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 2724 | ▶ | my $info = $self->schema->source($moniker)->column_info($col) or return 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | 2724 | ▶ | return (exists $info->{is_serializable} && !$info->{is_serializable}) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $info->{"is_serializable"} and not $info->{"is_serializable"}
MC/DC50%1/2
exists $info->{"is_serializable"} and not $info->{"is_serializable"}
exists $info->{"is_serializable"}
not $info->{"is_serializable"}
Truth table66%2/3
A and not(B)
A= exists $info->{"is_serializable"}B= not $info->{"is_serializable"}
| |||||||||||||||||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||
| 138 | 1336 | ▶ | sub readonly { $_[0]->_readonly->{ $_[1] }{ $_[2] } ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
readonly: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||
| 141 | 650 | ▶ | sub visible_columns { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
visible_columns: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 142 | 650 | my ($self, $moniker) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 143 | 650 | return grep { !$self->hidden($moniker, $_) } | |||||||||||||||||||||||||||||||||||||||||
| 144 | $self->schema->source($moniker)->columns; | ||||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||
| 148 | 298 | ▶ | sub writable_columns { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
writable_columns: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 149 | 298 | my ($self, $moniker) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 150 | 298 | return grep { !$self->readonly($moniker, $_) } $self->visible_columns($moniker); | |||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||
| 154 | 57 | ▶ | sub check_depth { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check_depth: called CC=4 SCAR=14.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 155 | 57 | my ($self, $info) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 156 | 57 | ▶ | return unless $info && ref $info->{path} eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$info and ref $info->{"path"} eq "ARRAY"
MC/DC0%0/2
$info and ref $info->{"path"} eq "ARRAY"
$info
ref $info->{"path"} eq "ARRAY"
Truth table33%1/3
A and B
A= $infoB= ref $info->{"path"} eq "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||
| 157 | 57 | my $depth = grep { $_ !~ /\A[0-9]+\z/ } @{ $info->{path} }; | |||||||||||||||||||||||||||||||||||||||||
| 158 | 57 | ▶ | die client_error "DBIO::GraphQL: query depth exceeds max_depth (" . $self->max_depth . ")\n" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | if $depth > $self->max_depth; | ||||||||||||||||||||||||||||||||||||||||||
| 160 | 53 | return; | |||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||
| 164 | 289 | ▶ | sub authorize { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
authorize: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 165 | 289 | my ($self, $op, $moniker, $args, $ctx, $relationship) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 166 | 289 | ▶ | my $hook = $self->_authorize or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 167 | 29 | my $answer = $hook->($op, $moniker, $args, $ctx, $relationship); | |||||||||||||||||||||||||||||||||||||||||
| 168 | 29 | ▶ | die client_error "DBIO::GraphQL: not authorized\n" unless $answer; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 169 | 21 | ▶ | return (ref $answer eq 'HASH' && %$answer) ? $answer : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $answer eq "HASH" and %$answer
MC/DC50%1/2
ref $answer eq "HASH" and %$answer
ref $answer eq "HASH"
%$answer
Truth table66%2/3
A and B
A= ref $answer eq "HASH"B= %$answer
| |||||||||||||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||
| 172 | 14 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||
| 174 | __END__ | ||||||||||||||||||||||||||||||||||||||||||