From 08a7747feb51aa087d605d2ee6137343dfa270ce Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Tue, 18 Mar 2014 18:53:30 +0000 Subject: remove $_ usage that warns under perl 5.18 --- usr.sbin/pkg_add/OpenBSD/PackageRepository/HTTP.pm | 15 +++++++-------- usr.sbin/pkg_add/OpenBSD/PackageRepository/Persistant.pm | 4 +--- usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm | 5 +---- 3 files changed, 9 insertions(+), 15 deletions(-) (limited to 'usr.sbin/pkg_add/OpenBSD/PackageRepository') diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/HTTP.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/HTTP.pm index 8702e1ece7f..6cfcdea6301 100755 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository/HTTP.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository/HTTP.pm @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: HTTP.pm,v 1.10 2011/07/19 18:09:41 espie Exp $ +# $OpenBSD: HTTP.pm,v 1.11 2014/03/18 18:53:29 espie Exp $ # # Copyright (c) 2011 Marc Espie # @@ -104,18 +104,18 @@ sub send_header sub get_header { my $o = shift; - my $_ = $o->getline; - if (!m,^HTTP/1\.1\s+(\d\d\d),) { + my $l = $o->getline; + if ($l !~ m,^HTTP/1\.1\s+(\d\d\d),) { return undef; } my $h = _Proxy::Header->new; $h->{code} = $1; - while ($_ = $o->getline) { - last if m/^$/; - if (m/^([\w\-]+)\:\s*(.*)$/) { + while ($l = $o->getline) { + last if $l =~ m/^$/; + if ($l =~ m/^([\w\-]+)\:\s*(.*)$/) { $h->{$1} = $2; } else { - print STDERR "unknown line: $_\n"; + print STDERR "unknown line: $l\n"; } } if (defined $h->{'Content-Length'}) { @@ -336,7 +336,6 @@ sub get_file sub main { my $self = shift; - my $_; my $o = _Proxy::Connection->new($self->{host}, "www"); while () { chomp; diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Persistant.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Persistant.pm index 3aaeeed153c..dcac9993407 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Persistant.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Persistant.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Persistant.pm,v 1.3 2014/01/09 20:20:01 espie Exp $ +# $OpenBSD: Persistant.pm,v 1.4 2014/03/18 18:53:29 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -38,7 +38,6 @@ sub grab_object my $getfh = $self->{getfh}; print $cmdfh "ABORT\n"; - my $_; while (<$getfh>) { last if m/^ABORTED/o; } @@ -98,7 +97,6 @@ sub list my $path = $self->{path}; my $l = []; print $cmdfh "LIST $path\n"; - my $_; $_ = <$getfh>; if (!defined $_) { $self->{state}->fatal("Could not initiate #1 session", diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm index e0aa597a2dd..cf5f7ee6859 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: SCP.pm,v 1.27 2011/07/19 17:30:05 espie Exp $ +# $OpenBSD: SCP.pm,v 1.28 2014/03/18 18:53:29 espie Exp $ # # Copyright (c) 2003-2006 Marc Espie # @@ -45,8 +45,6 @@ sub initiate $self->{cmdfh} = $wrfh; $self->{getfh} = $rdfh; $wrfh->autoflush(1); - my $_; - while() { # compress script a bit next if m/^\#/o && !m/^\#!/o; @@ -103,7 +101,6 @@ sub expand_tilde return $dirs->{$arg} //= (getpwnam($arg))[7]."/"; } -my $_; while () { chomp; if (m/^LIST\s+(.*)$/o) { -- cgit v1.2.3