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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s