equal
deleted
inserted
replaced
1 package Fops; |
1 package Fops; |
2 use strict; |
2 use strict; |
3 use warnings; |
3 use warnings; |
4 use Carp; |
4 use Carp; |
5 |
5 |
|
6 our $VERSION = "0.1"; |
|
7 |
6 sub new { |
8 sub new { |
7 my $class = ref $_[0] ? ref shift : shift; |
9 my $class = ref $_[0] ? ref shift : shift; |
8 my $implementation = shift; |
10 my $implementation = shift; |
9 eval "require Fops::$implementation"; |
11 eval "require Fops::$implementation" |
|
12 or die $@; |
|
13 |
|
14 #"Fops::$implementation"->import("0.1"); |
10 return "Fops::$implementation"->new(@_); |
15 return "Fops::$implementation"->new(@_); |
11 } |
16 } |
12 |
17 |
13 sub type { shift->{type} } |
18 sub type { shift->{type} } |
|
19 sub pwd { shift->{cwd} } |
14 |
20 |
15 sub cd { |
21 sub cd { |
16 my $self = shift; |
22 my $self = shift; |
17 croak "method `cd' needs implementation in ".ref $self; |
23 croak "method `cd' needs implementation in " . ref $self; |
18 } |
24 } |
19 |
|
20 |
25 |
21 1 |
26 1 |
22 __END__ |
27 __END__ |
23 |
28 |
24 =head1 NAME |
29 =head1 NAME |