blob: d2542aa5ba67517f022fd5162d4ba249abfa87bd (
plain) (
blame)
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
|
package IOFake;
sub new {
my $class = shift;
my $errors = shift;
my $self = {};
$self->{_count} = 2;
$self->{_errors} = $errors;
bless $self, $class;
return $self;
}
sub getline() {
my $self = shift;
if ($self->{_count} > 0) {
return $self->{_count}--;
}
$self->{_errors}->print('IOFake getline() $/ is ' . ${ $/ });
return;
}
sub close() {
my $self = shift;
$self->{_errors}->print('IOFake close() called');
};
1;
|