ports/textproc/p5-Text-RecordParser/files/5.005-RecordParser.pm
Mathieu Arnold 580907f6e3 Add a small patch so that 5.005 works too
Approved by:	maintainer
2004-05-06 14:16:55 +00:00

24 lines
865 B
Perl

--- RecordParser.pm~ Tue Dec 16 21:43:05 2003
+++ RecordParser.pm Thu May 6 11:45:45 2004
@@ -523,8 +523,8 @@
if ( !defined $self->{'fh'} && $self->{'filename'} ) {
my $file = $self->{'filename'};
- open my $fh, "<$file" or croak("Cannot read '$file': $!");
- $self->{'fh'} = $fh;
+ open FH, "<$file" or croak("Cannot read '$file': $!");
+ $self->{'fh'} = \*FH;
}
return $self->{'fh'};
@@ -727,8 +727,8 @@
croak( "Cannot use directory '$filename' as input source" );
}
elsif ( -f _ && -r _ ) {
- if ( my $fh = $self->fh ) {
- close $fh or croak(
+ if ( $self->fh ) {
+ close $self->fh or croak(
"Can't close '", $self->{'filename'}, "': $!\n"
);
$self->{'fh'} = undef;