-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathimport.pl
More file actions
48 lines (29 loc) · 650 Bytes
/
import.pl
File metadata and controls
48 lines (29 loc) · 650 Bytes
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
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/perl
=head1 PACKAGE P1
package P1;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(do_sum);
sub do_sum { return $_[0] + $_[1] }
1;
=head1 PACKAGE P2
package P2;
use parent qw(Exporter);
our @EXPORT = qw(do_mul);
sub do_mul { return $_[0] * $_[1] }
1;
=head1 PACKAGE P3 (Personal Favourite)
package P3;
use Exporter qw(import);
our @EXPORT = qw(do_sub);
sub do_sub { return $_[0] - $_[1] }
1;
=cut
use strict; use warnings;
use lib 'misc/';
use P1;
use P2;
use P3;
print do_sum(3,2), "\n";
print do_mul(3,2), "\n";
print do_sub(3,2), "\n";