SM0 She11
Path:
/
/
usr
/
share
/
perl5
/
vendor_perl
Full Path (server): /usr/share/perl5/vendor_perl
Create Fil3
Upl04d Fil3
π App
Open
[D]
[R]
π Archive
Open
[D]
[R]
π Authen
Open
[D]
[R]
π Bundle
Open
[D]
[R]
π Business
Open
[D]
[R]
π Carp
Open
[D]
[R]
π Carp.pm
[E]
[D]
[R]
π Class
Open
[D]
[R]
π Convert
Open
[D]
[R]
π Data
Open
[D]
[R]
π Date
Open
[D]
[R]
π Digest
Open
[D]
[R]
π Digest.pm
[E]
[D]
[R]
π Email
Open
[D]
[R]
π Encode
Open
[D]
[R]
π Error
Open
[D]
[R]
π Error.pm
[E]
[D]
[R]
π Exporter
Open
[D]
[R]
π Exporter.pm
[E]
[D]
[R]
π ExtUtils
Open
[D]
[R]
π File
Open
[D]
[R]
π Getopt
Open
[D]
[R]
π Git
Open
[D]
[R]
π Git.pm
[E]
[D]
[R]
π HTML
Open
[D]
[R]
π HTTP
Open
[D]
[R]
π IO
Open
[D]
[R]
π JSON
Open
[D]
[R]
π JSON.pm
[E]
[D]
[R]
π LWP
Open
[D]
[R]
π Log
Open
[D]
[R]
π MIME
Open
[D]
[R]
π Mail
Open
[D]
[R]
π Module
Open
[D]
[R]
π Mozilla
Open
[D]
[R]
π Net
Open
[D]
[R]
π POD2
Open
[D]
[R]
π Package
Open
[D]
[R]
π Parse
Open
[D]
[R]
π Pod
Open
[D]
[R]
π RPC
Open
[D]
[R]
π Readonly.pm
[E]
[D]
[R]
π Sub
Open
[D]
[R]
π TAP
Open
[D]
[R]
π Test
Open
[D]
[R]
π Text
Open
[D]
[R]
π Thread
Open
[D]
[R]
π Time
Open
[D]
[R]
π Try
Open
[D]
[R]
π WWW
Open
[D]
[R]
π XML
Open
[D]
[R]
π auto
Open
[D]
[R]
π common
Open
[D]
[R]
π constant.pm
[E]
[D]
[R]
π newgetopt.pl
[E]
[D]
[R]
π parent.pm
[E]
[D]
[R]
π perldoc.pod
[E]
[D]
[R]
π spamassassin-run.pod
[E]
[D]
[R]
Editing: parent.pm
package parent; use strict; use vars qw($VERSION); $VERSION = '0.225'; sub import { my $class = shift; my $inheritor = caller(0); if ( @_ and $_[0] eq '-norequire' ) { shift @_; } else { for ( my @filename = @_ ) { if ( $_ eq $inheritor ) { warn "Class '$inheritor' tried to inherit from itself\n"; }; s{::|'}{/}g; require "$_.pm"; # dies if the file is not found } } { no strict 'refs'; push @{"$inheritor\::ISA"}, @_; }; }; "All your base are belong to us" __END__ =encoding utf8 =head1 NAME parent - Establish an ISA relationship with base classes at compile time =head1 SYNOPSIS package Baz; use parent qw(Foo Bar); =head1 DESCRIPTION Allows you to both load one or more modules, while setting up inheritance from those modules at the same time. Mostly similar in effect to package Baz; BEGIN { require Foo; require Bar; push @ISA, qw(Foo Bar); } By default, every base class needs to live in a file of its own. If you want to have a subclass and its parent class in the same file, you can tell C<parent> not to load any modules by using the C<-norequire> switch: package Foo; sub exclaim { "I CAN HAS PERL" } package DoesNotLoadFooBar; use parent -norequire, 'Foo', 'Bar'; # will not go looking for Foo.pm or Bar.pm This is equivalent to the following code: package Foo; sub exclaim { "I CAN HAS PERL" } package DoesNotLoadFooBar; push @DoesNotLoadFooBar::ISA, 'Foo', 'Bar'; This is also helpful for the case where a package lives within a differently named file: package MyHash; use Tie::Hash; use parent -norequire, 'Tie::StdHash'; This is equivalent to the following code: package MyHash; require Tie::Hash; push @ISA, 'Tie::StdHash'; If you want to load a subclass from a file that C<require> would not consider an eligible filename (that is, it does not end in either C<.pm> or C<.pmc>), use the following code: package MySecondPlugin; require './plugins/custom.plugin'; # contains Plugin::Custom use parent -norequire, 'Plugin::Custom'; =head1 DIAGNOSTICS =over 4 =item Class 'Foo' tried to inherit from itself Attempting to inherit from yourself generates a warning. package Foo; use parent 'Foo'; =back =head1 HISTORY This module was forked from L<base> to remove the cruft that had accumulated in it. =head1 CAVEATS =head1 SEE ALSO L<base> =head1 AUTHORS AND CONTRIBUTORS RafaΓ«l Garcia-Suarez, Bart Lateur, Max Maischein, Anno Siegel, Michael Schwern =head1 MAINTAINER Max Maischein C< corion@cpan.org > Copyright (c) 2007-10 Max Maischein C<< <corion@cpan.org> >> Based on the idea of C<base.pm>, which was introduced with Perl 5.004_04. =head1 LICENSE This module is released under the same terms as Perl itself. =cut
Save