/
usr
/
share
/
perl5
/
/usr/share/perl5
mkdir
upload
Name
Size
Mode
Actions
App/
-
0755
rm
Archive/
-
0755
rm
Attribute/
-
0755
rm
autodie/
-
0755
rm
B/
-
0755
rm
Carp/
-
0755
rm
CGI/
-
0755
rm
Class/
-
0755
rm
Config/
-
0755
rm
CPAN/
-
0755
rm
CPANPLUS/
-
0755
rm
DBIx/
-
0755
rm
DBM_Filter/
-
0755
rm
Devel/
-
0755
rm
Digest/
-
0755
rm
Encode/
-
0755
rm
encoding/
-
0755
rm
Exporter/
-
0755
rm
ExtUtils/
-
0755
rm
File/
-
0755
rm
Filter/
-
0755
rm
Getopt/
-
0755
rm
HTML/
-
0755
rm
I18N/
-
0755
rm
IO/
-
0755
rm
IPC/
-
0755
rm
JSON/
-
0755
rm
Locale/
-
0755
rm
Log/
-
0755
rm
Math/
-
0755
rm
Memoize/
-
0755
rm
Module/
-
0755
rm
Net/
-
0755
rm
Object/
-
0755
rm
overload/
-
0755
rm
Package/
-
0755
rm
Params/
-
0755
rm
Parse/
-
0755
rm
PerlIO/
-
0755
rm
Pod/
-
0755
rm
pod/
-
0755
rm
Search/
-
0755
rm
TAP/
-
0755
rm
Term/
-
0755
rm
Test/
-
0755
rm
Test2/
-
0755
rm
Text/
-
0755
rm
Thread/
-
0755
rm
Tie/
-
0755
rm
Time/
-
0755
rm
Unicode/
-
0755
rm
unicore/
-
0755
rm
URI/
-
0755
rm
User/
-
0755
rm
vendor_perl/
-
0755
rm
version/
-
0755
rm
warnings/
-
0755
rm
abbrev.pl
838
0644
edit
dl
rm
AnyDBM_File.pm
2594
0644
edit
dl
rm
assert.pl
1298
0644
edit
dl
rm
attributes.pm
14877
0644
edit
dl
rm
autodie.pm
11763
0644
edit
dl
rm
AutoLoader.pm
14997
0644
edit
dl
rm
AutoSplit.pm
19637
0644
edit
dl
rm
autouse.pm
4238
0644
edit
dl
rm
base.pm
6986
0644
edit
dl
rm
Benchmark.pm
28530
0644
edit
dl
rm
bigfloat.pl
7368
0644
edit
dl
rm
bigint.pl
8959
0644
edit
dl
rm
bigint.pm
17852
0644
edit
dl
rm
bignum.pm
18673
0644
edit
dl
rm
bigrat.pl
4476
0644
edit
dl
rm
bigrat.pm
14442
0644
edit
dl
rm
blib.pm
2106
0644
edit
dl
rm
bytes.pm
2384
0644
edit
dl
rm
bytes_heavy.pl
758
0644
edit
dl
rm
cacheout.pl
1122
0644
edit
dl
rm
Carp.pm
7611
0644
edit
dl
rm
CGI.pm
261478
0644
edit
dl
rm
charnames.pm
15670
0644
edit
dl
rm
complete.pl
3191
0644
edit
dl
rm
constant.pm
12528
0644
edit
dl
rm
CORE.pod
1569
0644
edit
dl
rm
CPAN.pm
130907
0644
edit
dl
rm
CPANPLUS.pm
7269
0644
edit
dl
rm
ctime.pl
1993
0644
edit
dl
rm
DB.pm
19202
0644
edit
dl
rm
DBM_Filter.pm
14415
0644
edit
dl
rm
diagnostics.pm
17380
0644
edit
dl
rm
Digest.pm
10412
0644
edit
dl
rm
DirHandle.pm
1937
0644
edit
dl
rm
dotsh.pl
2175
0644
edit
dl
rm
Dumpvalue.pm
16899
0644
edit
dl
rm
dumpvar.pl
15275
0644
edit
dl
rm
English.pm
4488
0644
edit
dl
rm
Env.pm
5170
0644
edit
dl
rm
exceptions.pl
1736
0644
edit
dl
rm
Expect.pm
54725
0644
edit
dl
rm
Expect.pod
43735
0644
edit
dl
rm
Exporter.pm
18595
0644
edit
dl
rm
fastcwd.pl
1019
0644
edit
dl
rm
Fatal.pm
40966
0644
edit
dl
rm
feature.pm
5092
0644
edit
dl
rm
fields.pm
9507
0644
edit
dl
rm
FileCache.pm
5570
0644
edit
dl
rm
FileHandle.pm
6778
0644
edit
dl
rm
filetest.pm
4003
0644
edit
dl
rm
find.pl
1185
0644
edit
dl
rm
FindBin.pm
5658
0644
edit
dl
rm
finddepth.pl
1130
0644
edit
dl
rm
flush.pl
642
0644
edit
dl
rm
getcwd.pl
1427
0644
edit
dl
rm
getopt.pl
1322
0644
edit
dl
rm
getopts.pl
1406
0644
edit
dl
rm
hostname.pl
727
0644
edit
dl
rm
if.pm
1166
0644
edit
dl
rm
importenv.pl
283
0644
edit
dl
rm
integer.pm
3266
0644
edit
dl
rm
less.pm
3084
0644
edit
dl
rm
locale.pm
820
0644
edit
dl
rm
look.pl
1255
0644
edit
dl
rm
Memoize.pm
35295
0644
edit
dl
rm
newgetopt.pl
2213
0644
edit
dl
rm
NEXT.pm
18481
0644
edit
dl
rm
ok.pm
967
0444
edit
dl
rm
open.pm
7740
0644
edit
dl
rm
open2.pl
185
0644
edit
dl
rm
open3.pl
185
0644
edit
dl
rm
overload.pm
48050
0644
edit
dl
rm
overloading.pm
1801
0644
edit
dl
rm
parent.pm
2998
0644
edit
dl
rm
perl5db.pl
317682
0644
edit
dl
rm
PerlIO.pm
11122
0644
edit
dl
rm
pwd.pl
1478
0644
edit
dl
rm
Safe.pm
24326
0644
edit
dl
rm
SelectSaver.pm
1076
0644
edit
dl
rm
SelfLoader.pm
17341
0644
edit
dl
rm
Shell.pm
8685
0644
edit
dl
rm
shellwords.pl
276
0644
edit
dl
rm
sigtrap.pm
7611
0644
edit
dl
rm
sort.pm
6093
0644
edit
dl
rm
stat.pl
590
0644
edit
dl
rm
strict.pm
3716
0644
edit
dl
rm
subs.pm
842
0644
edit
dl
rm
Switch.pm
28508
0644
edit
dl
rm
Symbol.pm
4794
0644
edit
dl
rm
syslog.pl
4806
0644
edit
dl
rm
tainted.pl
164
0644
edit
dl
rm
termcap.pl
4114
0644
edit
dl
rm
Test.pm
28800
0644
edit
dl
rm
Test2.pm
6393
0444
edit
dl
rm
Thread.pm
8285
0644
edit
dl
rm
timelocal.pl
690
0644
edit
dl
rm
UNIVERSAL.pm
6536
0644
edit
dl
rm
utf8.pm
6918
0644
edit
dl
rm
utf8_heavy.pl
8001
0644
edit
dl
rm
validate.pl
3731
0644
edit
dl
rm
vars.pm
2358
0644
edit
dl
rm
version.pm
1037
0644
edit
dl
rm
version.pod
12315
0644
edit
dl
rm
vmsish.pm
4328
0644
edit
dl
rm
warnings.pm
16133
0644
edit
dl
rm
Edit:
/usr/share/perl5/base.pm
(6986B)
package base; use strict 'vars'; use vars qw($VERSION); $VERSION = '2.14'; $VERSION = eval $VERSION; # constant.pm is slow sub SUCCESS () { 1 } sub PUBLIC () { 2**0 } sub PRIVATE () { 2**1 } sub INHERITED () { 2**2 } sub PROTECTED () { 2**3 } my $Fattr = \%fields::attr; sub has_fields { my($base) = shift; my $fglob = ${"$base\::"}{FIELDS}; return( ($fglob && 'GLOB' eq ref($fglob) && *$fglob{HASH}) ? 1 : 0 ); } sub has_version { my($base) = shift; my $vglob = ${$base.'::'}{VERSION}; return( ($vglob && *$vglob{SCALAR}) ? 1 : 0 ); } sub has_attr { my($proto) = shift; my($class) = ref $proto || $proto; return exists $Fattr->{$class}; } sub get_attr { $Fattr->{$_[0]} = [1] unless $Fattr->{$_[0]}; return $Fattr->{$_[0]}; } if ($] < 5.009) { *get_fields = sub { # Shut up a possible typo warning. () = \%{$_[0].'::FIELDS'}; my $f = \%{$_[0].'::FIELDS'}; # should be centralized in fields? perhaps # fields::mk_FIELDS_be_OK. Peh. As long as %{ $package . '::FIELDS' } # is used here anyway, it doesn't matter. bless $f, 'pseudohash' if (ref($f) ne 'pseudohash'); return $f; } } else { *get_fields = sub { # Shut up a possible typo warning. () = \%{$_[0].'::FIELDS'}; return \%{$_[0].'::FIELDS'}; } } sub import { my $class = shift; return SUCCESS unless @_; # List of base classes from which we will inherit %FIELDS. my $fields_base; my $inheritor = caller(0); my @isa_classes; my @bases; foreach my $base (@_) { if ( $inheritor eq $base ) { warn "Class '$inheritor' tried to inherit from itself\n"; } next if grep $_->isa($base), ($inheritor, @bases); if (has_version($base)) { ${$base.'::VERSION'} = '-1, set by base.pm' unless defined ${$base.'::VERSION'}; } else { my $sigdie; { local $SIG{__DIE__}; eval "require $base"; # Only ignore "Can't locate" errors from our eval require. # Other fatal errors (syntax etc) must be reported. die if $@ && $@ !~ /^Can't locate .*? at \(eval /; unless (%{"$base\::"}) { require Carp; local $" = " "; Carp::croak(<<ERROR); Base class package "$base" is empty. (Perhaps you need to 'use' the module which defines that package first, or make that module available in \@INC (\@INC contains: @INC). ERROR } $sigdie = $SIG{__DIE__} || undef; } # Make sure a global $SIG{__DIE__} makes it out of the localization. $SIG{__DIE__} = $sigdie if defined $sigdie; ${$base.'::VERSION'} = "-1, set by base.pm" unless defined ${$base.'::VERSION'}; } push @bases, $base; if ( has_fields($base) || has_attr($base) ) { # No multiple fields inheritance *suck* if ($fields_base) { require Carp; Carp::croak("Can't multiply inherit fields"); } else { $fields_base = $base; } } } # Save this until the end so it's all or nothing if the above loop croaks. push @{"$inheritor\::ISA"}, @isa_classes; push @{"$inheritor\::ISA"}, @bases; if( defined $fields_base ) { inherit_fields($inheritor, $fields_base); } } sub inherit_fields { my($derived, $base) = @_; return SUCCESS unless $base; my $battr = get_attr($base); my $dattr = get_attr($derived); my $dfields = get_fields($derived); my $bfields = get_fields($base); $dattr->[0] = @$battr; if( keys %$dfields ) { warn <<"END"; $derived is inheriting from $base but already has its own fields! This will cause problems. Be sure you use base BEFORE declaring fields. END } # Iterate through the base's fields adding all the non-private # ones to the derived class. Hang on to the original attribute # (Public, Private, etc...) and add Inherited. # This is all too complicated to do efficiently with add_fields(). while (my($k,$v) = each %$bfields) { my $fno; if ($fno = $dfields->{$k} and $fno != $v) { require Carp; Carp::croak ("Inherited fields can't override existing fields"); } if( $battr->[$v] & PRIVATE ) { $dattr->[$v] = PRIVATE | INHERITED; } else { $dattr->[$v] = INHERITED | $battr->[$v]; $dfields->{$k} = $v; } } foreach my $idx (1..$#{$battr}) { next if defined $dattr->[$idx]; $dattr->[$idx] = $battr->[$idx] & INHERITED; } } 1; __END__ =head1 NAME base - Establish an ISA relationship with base classes at compile time =head1 SYNOPSIS package Baz; use base qw(Foo Bar); =head1 DESCRIPTION Unless you are using the C<fields> pragma, consider this module discouraged in favor of the lighter-weight C<parent>. Allows you to both load one or more modules, while setting up inheritance from those modules at the same time. Roughly similar in effect to package Baz; BEGIN { require Foo; require Bar; push @ISA, qw(Foo Bar); } C<base> employs some heuristics to determine if a module has already been loaded, if it has it doesn't try again. If C<base> tries to C<require> the module it will not die if it cannot find the module's file, but will die on any other error. After all this, should your base class be empty, containing no symbols, it will die. This is useful for inheriting from classes in the same file as yourself, like so: package Foo; sub exclaim { "I can have such a thing?!" } package Bar; use base "Foo"; If $VERSION is not detected even after loading it, <base> will define $VERSION in the base package, setting it to the string C<-1, set by base.pm>. C<base> will also initialize the fields if one of the base classes has it. Multiple inheritance of fields is B<NOT> supported, if two or more base classes each have inheritable fields the 'base' pragma will croak. See L<fields>, L<public> and L<protected> for a description of this feature. The base class' C<import> method is B<not> called. =head1 DIAGNOSTICS =over 4 =item Base class package "%s" is empty. base.pm was unable to require the base package, because it was not found in your path. =item Class 'Foo' tried to inherit from itself Attempting to inherit from yourself generates a warning. use Foo; use base 'Foo'; =back =head1 HISTORY This module was introduced with Perl 5.004_04. =head1 CAVEATS Due to the limitations of the implementation, you must use base I<before> you declare any of your own fields. =head1 SEE ALSO L<fields> =cut
Save
cmd:
run