File: test20-streval.p

package info (click to toggle)
libdevel-nytprof-perl 5.06%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,396 kB
  • ctags: 1,413
  • sloc: perl: 4,905; ansic: 101; sh: 54; makefile: 17
file content (14 lines) | stat: -rw-r--r-- 272 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# test merging of sub calls from eval fids

sub foo { print "foo\n" }

my $code = 'foo()';

# call once from particular line
eval $code;

# call twice from the same line
eval $code or die $@; eval $code or die $@;

# once from an eval inside an eval
eval "eval q{$code}";