File: 01_scoped.t

package info (click to toggle)
libguard-perl 1.022-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 104 kB
  • ctags: 1
  • sloc: perl: 12; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 371 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
BEGIN { $| = 1; print "1..10\n"; }

use Guard;

print "ok 1\n";

our $global = 0;

{
   scope_guard {
      print "ok 3\n"
   };
   local $global = 1;
   print "ok 2\n";
}

print "ok 4\n";

{
   scope_guard { print "ok 6\n" };
   print "ok 5\n";
   last;
}

print "ok 7\n";

{
   scope_guard { print "ok 9\n" };
   print "ok 8\n";
   exit;
}

END {
   print "ok 10\n";
}