Server IP : 103.119.228.120 / Your IP : 3.133.133.39 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/perl5/vendor_perl/ |
Upload File : |
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