This avoids needing to use a variable in package main to pass in information.
Also, remove an unnecessary $ENV{PERL5LIB} assignment cargo-culted into most
users of t/lib/common,pl, and remove the BEGIN block as the code it contained
doesn't need to run at BEGIN time.
$SIG{__WARN__} = sub { push @WARN, @_ };
}
-our $pragma_name = "charnames";
our $local_tests = 58;
# ---- For the alias extensions
#!./perl
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
- $ENV{PERL5LIB} = '../lib';
-}
-
-our $pragma_name = "feature";
+chdir 't' if -d 't';
+@INC = '../lib';
require "../t/lib/common.pl";
#!./perl
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
- $ENV{PERL5LIB} = '../lib';
-}
+chdir 't' if -d 't';
+@INC = '../lib';
-our $pragma_name = "strict";
our $local_tests = 4;
require "../t/lib/common.pl";
#!./perl
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
- $ENV{PERL5LIB} = '../lib';
-}
+chdir 't' if -d 't';
+@INC = '../lib';
-our $pragma_name = "subs";
require "../t/lib/common.pl";
#!./perl
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
- $ENV{PERL5LIB} = '../lib';
-}
+chdir 't' if -d 't';
+@INC = '../lib';
-our $pragma_name = "warnings";
our $UTF8 = (${^OPEN} || "") =~ /:utf8/;
require "../t/lib/common.pl";
use strict;
use warnings;
-our $pragma_name;
+my (undef, $file) = caller;
+my ($pragma_name) = $file =~ /([A-Za-z_0-9]+)\.t$/
+ or die "Can't identify pragama to test from file name '$file'";
$| = 1;