This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 1.0 patch 8: perl needed an eval operator and a symbolic debugger
[perl5.git] / t / op.eval
CommitLineData
a559c259
LW
1#!./perl
2
3print "1..6\n";
4
5eval 'print "ok 1\n";';
6
7if ($@ eq '') {print "ok 2\n";} else {print "not ok 2\n";}
8
9eval "\$foo\n = # this is a comment\n'ok 3';";
10print $foo,"\n";
11
12eval "\$foo\n = # this is a comment\n'ok 4\n';";
13print $foo;
14
15eval '
16$foo ='; # this tests for a call through yyerror()
17if ($@ =~ /line 2/) {print "ok 5\n";} else {print "not ok 5\n";}
18
19eval '$foo = /'; # this tests for a call through fatal()
20if ($@ =~ /Search/) {print "ok 6\n";} else {print "not ok 6\n";}