/usr/share/perl/5.22.1/vars.pm is in perl-modules-5.22 5.22.1-9ubuntu0.6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 36 37 38 39 40 41 42 43 44 45 46 47 | package vars;
use 5.006;
our $VERSION = '1.03';
use warnings::register;
use strict qw(vars subs);
sub import {
my $callpack = caller;
my (undef, @imports) = @_;
my ($sym, $ch);
foreach (@imports) {
if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
if ($sym =~ /\W/) {
# time for a more-detailed check-up
if ($sym =~ /^\w+[[{].*[]}]$/) {
require Carp;
Carp::croak("Can't declare individual elements of hash or array");
} elsif (warnings::enabled() and length($sym) == 1 and $sym !~ tr/a-zA-Z//) {
warnings::warn("No need to declare built-in vars");
} elsif (($^H &= strict::bits('vars'))) {
require Carp;
Carp::croak("'$_' is not a valid variable name under strict vars");
}
}
$sym = "${callpack}::$sym" unless $sym =~ /::/;
*$sym =
( $ch eq "\$" ? \$$sym
: $ch eq "\@" ? \@$sym
: $ch eq "\%" ? \%$sym
: $ch eq "\*" ? \*$sym
: $ch eq "\&" ? \&$sym
: do {
require Carp;
Carp::croak("'$_' is not a valid variable name");
});
} else {
require Carp;
Carp::croak("'$_' is not a valid variable name");
}
}
};
1;
__END__
|