1#!/usr/bin/perl 2# 3# This code is used by lib/perl5db.t !!! 4# 5 6$all_ok = 1; 7*c = sub { }; 8 9if ("abcdefghi" =~ m/(abc)(def)(?{ c() })(ghi)/) { 10 print "ok 1\n"; 11 12 $all_ok = 0, print "not " if $1 ne 'abc'; 13 print "ok 2\n"; 14 15 $all_ok = 0, print "not " if $2 ne 'def'; 16 print "ok 3\n"; 17 18 $all_ok = 0, print "not " if $3 ne 'ghi'; 19 print "ok 4\n"; 20 21 $all_ok = 0, print "not " if $& ne 'abcdefghi'; 22 print "ok 5\n"; 23} 24else { 25 $all_ok = 0; 26 print "not ok 1\n"; 27 print "not ok 2\n"; 28 print "not ok 3\n"; 29 print "not ok 4\n"; 30 print "not ok 5\n"; 31} 32 33if ($all_ok) { 34 print "All tests successful."; 35} 36 37