| 1 | # Testing various types of eval calls. Some are processed differently internally | ||
| 2 | |||
| 3 | 48 | ▶ | sub foo { |
|
Subroutine
foo: called CC=1 SCAR=0.0
| |||
| 4 | 48 | print "in sub foo\n"; | |
| 5 | } | ||
| 6 | |||
| 7 | 16 | ▶ | sub bar { |
|
Subroutine
bar: called CC=1 SCAR=0.0
| |||
| 8 | 16 | print "in sub bar\n"; | |
| 9 | } | ||
| 10 | |||
| 11 | 16 | ▶ | sub baz { |
|
Subroutine
baz: called CC=1 SCAR=0.0
| |||
| 12 | 16 | print "in sub baz\n"; | |
| 13 | 16 | eval { foo(); # two stmts executed on this line (eval + foo() call) | |
| 14 | 16 | foo(); }; # one stmt executed on this line | |
| 15 | 16 | eval { x(); # two stmts executed on this line (eval + x() call), fails out of eval | |
| 16 | 0 | x(); }; # zero stmts because previous statement threw an exception | |
| 17 | } | ||
| 18 | |||
| 19 | 16 | eval "foo();"; # one stmt in this fid, one statement in eval fid | |
| 20 | 16 | eval { bar(); }; # two stmts | |
| 21 | 16 | baz(); | |