Next Making Programs Faster 96

Getting the Wrong Answer as Quickly as Possible

        #!/usr/bin/perl -w
        use Test::More 'no_plan';
        my $code = q{"x" . "y"};
        is(eval $code , 'xy', "string eval");
        is(eval{$code}, 'xy', "block eval");
        ok 1 - string eval
        not ok 2 - block eval
        #     Failed test (evaltest.pl at line 6)
        #          got: '"x" . "y"'
        #     expected: 'xy'
        1..2
        # Looks like you failed 1 tests of 2.

Next Copyright © 2003 M. J. Dominus