This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Variants of several regression tests that run the actul tests inside
[perl5.git] / t / op / reg_email.t
index c53dd82..177820c 100644 (file)
@@ -66,13 +66,18 @@ my $email = qr {
     (?&address)
 }x;
 
     (?&address)
 }x;
 
-my $count = 0;
 
 
-$| = 1;
-while (<DATA>) {
-    chomp;
-    next if /^#/;
-    print /^$email$/ ? "ok " : "not ok ", ++ $count, "\n";
+run_tests() unless caller;
+
+sub run_tests {
+    my $count = 0;
+
+    $| = 1;
+    while (<DATA>) {
+       chomp;
+       next if /^#/;
+       print /^$email$/ ? "ok " : "not ok ", ++ $count, "\n";
+    }
 }
 
 #
 }
 
 #