From: espie Date: Mon, 6 Nov 2023 08:05:45 +0000 (+0000) Subject: use modern file open instead of GLOBS X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2da37aacf31d776ee5d9d7a7a46d6594c2ef195d;p=openbsd use modern file open instead of GLOBS --- diff --git a/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm b/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm index 3f2e7ea18ec..7095c64f701 100644 --- a/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm +++ b/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm @@ -312,15 +312,15 @@ sub Tgetent $state = 1; # ok, maybe do a new file next time } - open( TERMCAP, "< $TERMCAP\0" ) || croak "open $TERMCAP: $!"; - while () { + open(my $fh, '<', $TERMCAP) || croak "open $TERMCAP: $!"; + while (<$fh>) { next if /^\t/ || /^#/; if (m/(^|\|)\Q$tmp_term\E[:|]/) { chomp; s/^[^:]*:// if $first++; $state = 0; while (s/\\$//) { - defined(my $x = ) or last; + defined(my $x = <$fh>) or last; $_ .= $x; chomp; } last; @@ -328,7 +328,7 @@ sub Tgetent } defined $entry or $entry = ''; $entry .= $_ if $_; - close TERMCAP; + close $fh; # If :tc=...: found then search this file again $entry =~ s/:tc=([^:]+):/:/ && ( $tmp_term = $1, $state = 2 );