File: test13.p

package info (click to toggle)
libdevel-nytprof-perl 6.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,552 kB
  • sloc: perl: 5,616; javascript: 4,033; ansic: 107; makefile: 23
file content (21 lines) | stat: -rw-r--r-- 594 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Testing various types of eval calls. Some are processed differently internally

sub foo {
  print "in sub foo\n";
}

sub bar {
  print "in sub bar\n";
}

sub baz {
  print "in sub baz\n";
  eval { foo();    # two stmts executed on this line (eval + foo() call)
         foo(); }; # one stmt  executed on this line
  eval { x();      # two stmts executed on this line (eval + x() call), fails out of eval
         x(); };   # zero stmts because previous statement threw an exception
}

eval "foo();";     # one stmt in this fid, one statement in eval fid
eval { bar(); };   # two stmts
baz();