SILENT KILLERPanel

Current Path: > > > usr > share > perl5


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: ///usr/share/perl5

NameTypeSizeLast ModifiedActions
Attribute Directory - -
B Directory - -
CPAN Directory - -
Class Directory - -
Compress Directory - -
Config Directory - -
DBM_Filter Directory - -
Devel Directory - -
ExtUtils Directory - -
File Directory - -
Getopt Directory - -
I18N Directory - -
IO Directory - -
IPC Directory - -
Locale Directory - -
Math Directory - -
Memoize Directory - -
Module Directory - -
Net Directory - -
Pod Directory - -
Search Directory - -
Term Directory - -
Text Directory - -
Thread Directory - -
Tie Directory - -
Time Directory - -
URI Directory - -
Unicode Directory - -
User Directory - -
encoding Directory - -
overload Directory - -
pod Directory - -
unicore Directory - -
vendor_perl Directory - -
warnings Directory - -
AnyDBM_File.pm File 2618 bytes July 28 2025 08:07:09.
AutoLoader.pm File 15797 bytes July 28 2025 08:07:09.
AutoSplit.pm File 19637 bytes July 28 2025 08:07:09.
Benchmark.pm File 31025 bytes July 28 2025 08:07:09.
CORE.pod File 3188 bytes July 28 2025 08:07:09.
DB.pm File 18922 bytes July 28 2025 08:07:09.
DBM_Filter.pm File 14385 bytes July 28 2025 08:07:09.
DirHandle.pm File 1556 bytes July 28 2025 08:07:09.
Dumpvalue.pm File 17556 bytes July 28 2025 08:07:09.
English.pm File 4761 bytes July 28 2025 08:07:09.
FileCache.pm File 5572 bytes July 28 2025 08:07:09.
FileHandle.pm File 6784 bytes July 28 2025 08:07:09.
FindBin.pm File 4561 bytes July 28 2025 08:07:09.
Internals.pod File 2576 bytes July 28 2025 08:07:09.
Memoize.pm File 36192 bytes July 28 2025 08:08:32.
NEXT.pm File 18846 bytes July 28 2025 08:07:09.
PerlIO.pm File 10459 bytes July 28 2025 08:07:09.
Safe.pm File 25082 bytes July 28 2025 08:07:09.
SelectSaver.pm File 1076 bytes July 28 2025 08:07:09.
SelfLoader.pm File 17692 bytes July 28 2025 08:08:32.
Symbol.pm File 4799 bytes July 28 2025 08:07:09.
Test.pm File 30057 bytes July 28 2025 08:08:32.
Thread.pm File 8287 bytes July 28 2025 08:07:09.
UNIVERSAL.pm File 6594 bytes July 28 2025 08:07:09.
URI.pm File 34790 bytes January 09 2018 06:42:55.
XSLoader.pm File 11267 bytes July 28 2025 08:07:09.
_charnames.pm File 33166 bytes July 28 2025 08:07:09.
autouse.pm File 4238 bytes July 28 2025 08:07:09.
base.pm File 10980 bytes July 28 2025 08:07:09.
blib.pm File 2086 bytes July 28 2025 08:07:09.
bytes.pm File 3754 bytes July 28 2025 08:07:09.
bytes_heavy.pl File 758 bytes July 28 2025 08:07:09.
charnames.pm File 20867 bytes July 28 2025 08:07:09.
deprecate.pm File 3079 bytes July 28 2025 08:07:09.
diagnostics.pm File 19038 bytes July 28 2025 08:07:09.
dumpvar.pl File 15555 bytes July 28 2025 08:07:09.
feature.pm File 17085 bytes July 28 2025 08:07:09.
fields.pm File 9489 bytes July 28 2025 08:07:09.
filetest.pm File 4003 bytes July 28 2025 08:07:09.
if.pm File 3340 bytes July 28 2025 08:07:09.
integer.pm File 3254 bytes July 28 2025 08:07:09.
less.pm File 3204 bytes July 28 2025 08:07:09.
locale.pm File 4855 bytes July 28 2025 08:07:09.
meta_notation.pm File 2117 bytes July 28 2025 08:07:09.
open.pm File 8021 bytes July 28 2025 08:08:32.
overload.pm File 53314 bytes July 28 2025 08:07:09.
overloading.pm File 1808 bytes July 28 2025 08:07:09.
perl5db.pl File 316420 bytes July 28 2025 08:07:09.
sigtrap.pm File 7606 bytes July 28 2025 08:07:09.
sort.pm File 6081 bytes July 28 2025 08:07:09.
strict.pm File 4738 bytes July 28 2025 08:07:09.
subs.pm File 848 bytes July 28 2025 08:07:09.
utf8.pm File 9116 bytes July 28 2025 08:07:09.
utf8_heavy.pl File 31615 bytes July 28 2025 08:07:09.
vars.pm File 2414 bytes July 28 2025 08:07:09.
vmsish.pm File 4313 bytes July 28 2025 08:07:09.
warnings.pm File 44756 bytes July 28 2025 08:07:09.

Reading File: ///usr/share/perl5/autouse.pm

package autouse;

#use strict;		# debugging only
use 5.006;		# use warnings

$autouse::VERSION = '1.11';

$autouse::DEBUG ||= 0;

sub vet_import ($);

sub croak {
    require Carp;
    Carp::croak(@_);
}

sub import {
    my $class = @_ ? shift : 'autouse';
    croak "usage: use $class MODULE [,SUBS...]" unless @_;
    my $module = shift;

    (my $pm = $module) =~ s{::}{/}g;
    $pm .= '.pm';
    if (exists $INC{$pm}) {
	vet_import $module;
	local $Exporter::ExportLevel = $Exporter::ExportLevel + 1;
	# $Exporter::Verbose = 1;
	return $module->import(map { (my $f = $_) =~ s/\(.*?\)$//; $f } @_);
    }

    # It is not loaded: need to do real work.
    my $callpkg = caller(0);
    print "autouse called from $callpkg\n" if $autouse::DEBUG;

    my $index;
    for my $f (@_) {
	my $proto;
	$proto = $1 if (my $func = $f) =~ s/\((.*)\)$//;

	my $closure_import_func = $func;	# Full name
	my $closure_func = $func;		# Name inside package
	my $index = rindex($func, '::');
	if ($index == -1) {
	    $closure_import_func = "${callpkg}::$func";
	} else {
	    $closure_func = substr $func, $index + 2;
	    croak "autouse into different package attempted"
		unless substr($func, 0, $index) eq $module;
	}

	my $load_sub = sub {
	    unless ($INC{$pm}) {
		require $pm;
		vet_import $module;
	    }
            no warnings qw(redefine prototype);
	    *$closure_import_func = \&{"${module}::$closure_func"};
	    print "autousing $module; "
		  ."imported $closure_func as $closure_import_func\n"
		if $autouse::DEBUG;
	    goto &$closure_import_func;
	};

	if (defined $proto) {
	    *$closure_import_func = eval "sub ($proto) { goto &\$load_sub }"
	        || die;
	} else {
	    *$closure_import_func = $load_sub;
	}
    }
}

sub vet_import ($) {
    my $module = shift;
    if (my $import = $module->can('import')) {
	croak "autoused module $module has unique import() method"
	    unless defined(&Exporter::import)
		   && ($import == \&Exporter::import ||
		       $import == \&UNIVERSAL::import)
    }
}

1;

__END__

=head1 NAME

autouse - postpone load of modules until a function is used

=head1 SYNOPSIS

  use autouse 'Carp' => qw(carp croak);
  carp "this carp was predeclared and autoused ";

=head1 DESCRIPTION

If the module C<Module> is already loaded, then the declaration

  use autouse 'Module' => qw(func1 func2($;$));

is equivalent to

  use Module qw(func1 func2);

if C<Module> defines func2() with prototype C<($;$)>, and func1() has
no prototypes.  (At least if C<Module> uses C<Exporter>'s C<import>,
otherwise it is a fatal error.)

If the module C<Module> is not loaded yet, then the above declaration
declares functions func1() and func2() in the current package.  When
these functions are called, they load the package C<Module> if needed,
and substitute themselves with the correct definitions.

=begin _deprecated

   use Module qw(Module::func3);

will work and is the equivalent to:

   use Module qw(func3);

It is not a very useful feature and has been deprecated.

=end _deprecated


=head1 WARNING

Using C<autouse> will move important steps of your program's execution
from compile time to runtime.  This can

=over 4

=item *

Break the execution of your program if the module you C<autouse>d has
some initialization which it expects to be done early.

=item *

hide bugs in your code since important checks (like correctness of
prototypes) is moved from compile time to runtime.  In particular, if
the prototype you specified on C<autouse> line is wrong, you will not
find it out until the corresponding function is executed.  This will be
very unfortunate for functions which are not always called (note that
for such functions C<autouse>ing gives biggest win, for a workaround
see below).

=back

To alleviate the second problem (partially) it is advised to write
your scripts like this:

  use Module;
  use autouse Module => qw(carp($) croak(&$));
  carp "this carp was predeclared and autoused ";

The first line ensures that the errors in your argument specification
are found early.  When you ship your application you should comment
out the first line, since it makes the second one useless.

=head1 AUTHOR

Ilya Zakharevich (ilya@math.ohio-state.edu)

=head1 SEE ALSO

perl(1).

=cut

SILENT KILLER Tool