use warnings;
use strict;
my @test_values = (
[ '0', '1' ],
[ '1', '1' ],
[ '0', '0' ],
[ 'A', 'A' ],
[ 'A', 'B' ],
[ '4349678L', '9' ],
[ '4347946L', '9' ],
[ '791517N', '9' ],
);
my $n = 0;
for my $ar_ref (@test_values) {
my @ch_val = @{$ar_ref};
$n++;
print $n. '.' . '#' x
20, "\n"; for my $op ( '&', '&&', 'and', '=', '==' ) {
test_op( $ch_val[0], $ch_val[1], $n, $op );
}
}
sub test_op {
my ( $key, $value, $n, $op ) = @_;
print "# [$key] $op [$value] "; my $rez = eval( '$key ' . $op . ' $value' ); if ($rez) {
}
else {
}
print '[' . $rez . "]\n"; }
dXNlIHdhcm5pbmdzOwp1c2Ugc3RyaWN0OwoKbXkgQHRlc3RfdmFsdWVzID0gKAogICAgWyAnMCcsICAgICAgICAnMScgXSwKICAgIFsgJzEnLCAgICAgICAgJzEnIF0sCiAgICBbICcwJywgICAgICAgICcwJyBdLAogICAgWyAnQScsICAgICAgICAnQScgXSwKICAgIFsgJ0EnLCAgICAgICAgJ0InIF0sCiAgICBbICc0MzQ5Njc4TCcsICc5JyBdLAogICAgWyAnNDM0Nzk0NkwnLCAnOScgXSwKICAgIFsgJzc5MTUxN04nLCAgJzknIF0sCik7Cm15ICRuID0gMDsKZm9yIG15ICRhcl9yZWYgKEB0ZXN0X3ZhbHVlcykgewogICAgbXkgQGNoX3ZhbCA9IEB7JGFyX3JlZn07CiAgICAkbisrOwogICAgcHJpbnQgJG4uICcuJyAuICcjJyB4IDIwLCAiXG4iOwogICAgZm9yIG15ICRvcCAoICcmJywgJyYmJywgJ2FuZCcsICc9JywgJz09JyApIHsKICAgICAgICB0ZXN0X29wKCAkY2hfdmFsWzBdLCAkY2hfdmFsWzFdLCAkbiwgJG9wICk7CiAgICB9Cn0KCnN1YiB0ZXN0X29wIHsKICAgIG15ICggJGtleSwgJHZhbHVlLCAkbiwgJG9wICkgPSBAXzsKICAgIHByaW50ICIjIFska2V5XSAkb3AgWyR2YWx1ZV0gIjsKICAgIG15ICRyZXogPSBldmFsKCAnJGtleSAnIC4gJG9wIC4gJyAkdmFsdWUnICk7CiAgICBpZiAoJHJleikgewogICAgICAgIHByaW50ICdkb25lJzsKICAgIH0KICAgIGVsc2UgewogICAgICAgIHByaW50ICdubyc7CiAgICB9CiAgICBwcmludCAnWycgLiAkcmV6IC4gIl1cbiI7Cn0K