File: parent.pm

package info (click to toggle)
libscalar-defer-perl 0.23-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 296 kB
  • sloc: perl: 3,700; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 752 bytes parent folder | download | duplicates (7)
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
#line 1
package parent;
use strict;
use vars qw($VERSION);
$VERSION = '0.223';

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';
        # This is more efficient than push for the new MRO
        # at least until the new MRO is fixed
        @{"$inheritor\::ISA"} = (@{"$inheritor\::ISA"} , @_);
    };
};

"All your base are belong to us"

__END__

#line 136