File: test22-strevala.p

package info (click to toggle)
libdevel-nytprof-perl 4.06-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,152 kB
  • sloc: perl: 4,451; ansic: 89; makefile: 19
file content (14 lines) | stat: -rw-r--r-- 286 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# test merging of anon subs from evals

my $code = 'sub { print "sub called\n" }';

# call once from particular line
eval($code)->();

# call twice from the same line
eval($code)->(); eval($code)->();

# called from inside a string eval
eval q{
    eval($code)->(); eval($code)->();
};