Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
    
    is($x1,$x2, "44.7 is 44.9-0.2"); #succeeds. because is uses the eq ope
    +rator...
    cmp_ok($x1,'==',$x2, "44.7 == 44.9-0.2"); # fails. but the diagnostic 
    +isn't real helpful.
    
  2. or download this
    E:\data\learning>perl scratch.pl
    ok 1 - 44.7 is 44.9-0.2
    ...
    #     expected: 44.7
    1..2
    # Looks like you failed 1 tests of 2.