PERL TESTING Print only ok/not ok

commandline session

$cat test5.pl
#!/usr/bin/perl
use strict;
use warnings;

my $result;

$result = `/usr/bin/concalc 1  + 1`;
print $result;
if ( $result == 1 ) {
    print "okn";
}
else {
    print "not okn";
}

$result = `/usr/bin/concalc 2 + 2`;
if ( $result == 4 ) {
    print "okn";
}
else {
    print "not okn";
}

$result = `/usr/bin/concalc 2 + 2 + 2`;
if ( $result == 6 ) {
    print "okn";
}
else {
    print "not okn";
}


$perl test5.pl tcsetattr fehler: Invalid argument tcsetattr error: Invalid argument 2 not ok tcsetattr fehler: Invalid argument tcsetattr error: Invalid argument ok tcsetattr fehler: Invalid argument tcsetattr error: Invalid argument ok $

Leave a comment

Your email address will not be published. Required fields are marked *