summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@cc.hut.fi>1997-01-02 17:27:47 +1200
committerChip Salzenberg <chip@atlantic.net>1997-01-04 17:44:00 +1200
commit40da2db335c65d50d3bca886fcc7161ed72faf74 (patch)
tree7fa3e6ca078a9a52592d28bd05a7f99be1af6544 /lib
parent5377b7012ceb2c72202db969f3b51a017f9551a9 (diff)
downloadperl-40da2db335c65d50d3bca886fcc7161ed72faf74.tar.gz
Make libs clean under '-w'
Diffstat (limited to 'lib')
-rw-r--r--lib/AutoSplit.pm2
-rw-r--r--lib/Devel/SelfStubber.pm4
-rw-r--r--lib/Env.pm4
-rw-r--r--lib/Math/Complex.pm28
-rw-r--r--lib/Pod/Functions.pm2
-rw-r--r--lib/Search/Dict.pm2
-rw-r--r--lib/SelfLoader.pm2
-rw-r--r--lib/Term/Complete.pm3
-rw-r--r--lib/chat2.pl2
-rw-r--r--lib/complete.pl3
-rw-r--r--lib/diagnostics.pm2
-rw-r--r--lib/ftp.pl4
-rw-r--r--lib/termcap.pl2
-rw-r--r--lib/validate.pl4
14 files changed, 35 insertions, 29 deletions
diff --git a/lib/AutoSplit.pm b/lib/AutoSplit.pm
index d9bd17a7f7..cc9de33f26 100644
--- a/lib/AutoSplit.pm
+++ b/lib/AutoSplit.pm
@@ -255,7 +255,7 @@ sub autosplit_file{
if (/^sub\s+([\w:]+)(\s*\(.*?\))?/) {
print OUT "1;\n";
my $subname = $1;
- $proto{$1} = $2 or '';
+ $proto{$1} = $2 || '';
if ($subname =~ m/::/){
warn "subs with package names not currently supported in AutoSplit section";
}
diff --git a/lib/Devel/SelfStubber.pm b/lib/Devel/SelfStubber.pm
index 7bb38f6957..4c2d039580 100644
--- a/lib/Devel/SelfStubber.pm
+++ b/lib/Devel/SelfStubber.pm
@@ -35,7 +35,7 @@ sub stub {
$fh = "${module}::DATA";
open($fh,$mod_file) || die "Unable to open $mod_file";
- while($line = <$fh> and $line !~ m/^__DATA__/) {
+ while(defined ($line = <$fh>) and $line !~ m/^__DATA__/) {
push(@BEFORE_DATA,$line);
$line =~ /use\s+SelfLoader/ && $found_selfloader++;
}
@@ -45,7 +45,7 @@ sub stub {
$self->_load_stubs($module);
if ( fileno($fh) ) {
$end = 1;
- while($line = <$fh>) {
+ while(defined($line = <$fh>)) {
push(@AFTER_DATA,$line);
}
}
diff --git a/lib/Env.pm b/lib/Env.pm
index 63beb07508..1f06bebf24 100644
--- a/lib/Env.pm
+++ b/lib/Env.pm
@@ -47,7 +47,11 @@ sub import {
my ($callpack) = caller(0);
my $pack = shift;
my @vars = @_ ? @_ : keys(%ENV);
+ return unless @vars;
+ eval "package $callpack; use vars qw("
+ . join(' ', map { '$'.$_ } @vars) . ")";
+ die $@ if $@;
foreach (@vars) {
tie ${"${callpack}::$_"}, Env, $_ if /^[A-Za-z_]\w*$/;
}
diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm
index aec0776c6c..fce53f7b81 100644
--- a/lib/Math/Complex.pm
+++ b/lib/Math/Complex.pm
@@ -56,7 +56,7 @@ $display = 'cartesian'; # Default display format
sub make {
my $self = bless {}, shift;
my ($re, $im) = @_;
- $self->{cartesian} = [$re, $im];
+ $self->{'cartesian'} = [$re, $im];
$self->{c_dirty} = 0;
$self->{p_dirty} = 1;
return $self;
@@ -71,7 +71,7 @@ sub emake {
my $self = bless {}, shift;
my ($rho, $theta) = @_;
$theta += pi() if $rho < 0;
- $self->{polar} = [abs($rho), $theta];
+ $self->{'polar'} = [abs($rho), $theta];
$self->{p_dirty} = 0;
$self->{c_dirty} = 1;
return $self;
@@ -118,8 +118,8 @@ sub pi () {
#
sub i () {
$i = bless {} unless $i; # There can be only one i
- $i->{cartesian} = [0, 1];
- $i->{polar} = [1, pi/2];
+ $i->{'cartesian'} = [0, 1];
+ $i->{'polar'} = [1, pi/2];
$i->{c_dirty} = 0;
$i->{p_dirty} = 0;
return $i;
@@ -129,11 +129,11 @@ sub i () {
# Attribute access/set routines
#
-sub cartesian {$_[0]->{c_dirty} ? $_[0]->update_cartesian : $_[0]->{cartesian}}
-sub polar {$_[0]->{p_dirty} ? $_[0]->update_polar : $_[0]->{polar}}
+sub cartesian {$_[0]->{c_dirty} ? $_[0]->update_cartesian : $_[0]->{'cartesian'}}
+sub polar {$_[0]->{p_dirty} ? $_[0]->update_polar : $_[0]->{'polar'}}
-sub set_cartesian { $_[0]->{p_dirty}++; $_[0]->{cartesian} = $_[1] }
-sub set_polar { $_[0]->{c_dirty}++; $_[0]->{polar} = $_[1] }
+sub set_cartesian { $_[0]->{p_dirty}++; $_[0]->{'cartesian'} = $_[1] }
+sub set_polar { $_[0]->{c_dirty}++; $_[0]->{'polar'} = $_[1] }
#
# ->update_cartesian
@@ -142,9 +142,9 @@ sub set_polar { $_[0]->{c_dirty}++; $_[0]->{polar} = $_[1] }
#
sub update_cartesian {
my $self = shift;
- my ($r, $t) = @{$self->{polar}};
+ my ($r, $t) = @{$self->{'polar'}};
$self->{c_dirty} = 0;
- return $self->{cartesian} = [$r * cos $t, $r * sin $t];
+ return $self->{'cartesian'} = [$r * cos $t, $r * sin $t];
}
#
@@ -155,10 +155,10 @@ sub update_cartesian {
#
sub update_polar {
my $self = shift;
- my ($x, $y) = @{$self->{cartesian}};
+ my ($x, $y) = @{$self->{'cartesian'}};
$self->{p_dirty} = 0;
- return $self->{polar} = [0, 0] if $x == 0 && $y == 0;
- return $self->{polar} = [sqrt($x*$x + $y*$y), atan2($y, $x)];
+ return $self->{'polar'} = [0, 0] if $x == 0 && $y == 0;
+ return $self->{'polar'} = [sqrt($x*$x + $y*$y), atan2($y, $x)];
}
#
@@ -707,7 +707,7 @@ sub stringify_cartesian {
$re = "$x" if abs($x) >= 1e-14;
if ($y == 1) { $im = 'i' }
elsif ($y == -1) { $im = '-i' }
- elsif (abs($y) >= 1e-14) { $im = "${y}i" }
+ elsif (abs($y) >= 1e-14) { $im = $y . "i" }
my $str;
$str = $re if defined $re;
diff --git a/lib/Pod/Functions.pm b/lib/Pod/Functions.pm
index a775cf6165..6db7cfd83c 100644
--- a/lib/Pod/Functions.pm
+++ b/lib/Pod/Functions.pm
@@ -5,7 +5,7 @@ package Pod::Functions;
require Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(%Kinds %Type %Flavor %Type_Descriptions @Type_Order);
+@EXPORT = qw(%Kinds %Type %Flavor %Type_Description @Type_Order);
%Type_Description = (
'ARRAY' => 'Functions for real @ARRAYs',
diff --git a/lib/Search/Dict.pm b/lib/Search/Dict.pm
index 1cd5cf8a11..9a229a7bc0 100644
--- a/lib/Search/Dict.pm
+++ b/lib/Search/Dict.pm
@@ -61,7 +61,7 @@ sub look {
<FH> if $min;
for (;;) {
$min = tell(FH);
- $_ = <FH>
+ defined($_ = <FH>)
or last;
chop;
s/[^\w\s]//g if $dict;
diff --git a/lib/SelfLoader.pm b/lib/SelfLoader.pm
index 11dc6a24bf..8d80b575a1 100644
--- a/lib/SelfLoader.pm
+++ b/lib/SelfLoader.pm
@@ -44,7 +44,7 @@ sub _load_stubs {
unless fileno($fh);
$Cache{"${currpack}::<DATA"} = 1; # indicate package is cached
- while($line = <$fh> and $line !~ m/^__END__/) {
+ while(defined($line = <$fh>) and $line !~ m/^__END__/) {
if ($line =~ m/^sub\s+([\w:]+)\s*(\([\$\@\;\%\\]*\))?/) { # A sub declared
push(@stubs, $self->_add_to_cache($name, $currpack, \@lines, $protoype));
$protoype = $2;
diff --git a/lib/Term/Complete.pm b/lib/Term/Complete.pm
index bdab2ad81d..e3c290aa02 100644
--- a/lib/Term/Complete.pm
+++ b/lib/Term/Complete.pm
@@ -112,7 +112,8 @@ sub Complete {
# (^U) kill
$_ eq $kill && do {
if ($r) {
- undef($r, $return);
+ undef $r;
+ undef $return;
print("\r\n");
redo LOOP;
}
diff --git a/lib/chat2.pl b/lib/chat2.pl
index 0d9a7d3d50..8320270175 100644
--- a/lib/chat2.pl
+++ b/lib/chat2.pl
@@ -264,7 +264,7 @@ ESQ
eval $cases; die "$cases:\n$@" if $@;
}
$eof = $timeout = 0;
- do $subname();
+ &$subname();
}
## &chat'print([$handle,] @data)
diff --git a/lib/complete.pl b/lib/complete.pl
index 335245269c..539f2f7798 100644
--- a/lib/complete.pl
+++ b/lib/complete.pl
@@ -75,7 +75,8 @@ sub Complete {
# (^U) kill
$_ eq $kill && do {
if ($r) {
- undef($r, $return);
+ undef $r;
+ undef $return;
print("\r\n");
redo LOOP;
}
diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm
index 3492bd3e28..b00349f7b0 100644
--- a/lib/diagnostics.pm
+++ b/lib/diagnostics.pm
@@ -352,7 +352,7 @@ EOFUNC
if ($standalone) {
if (!@ARGV and -t STDIN) { print STDERR "$0: Reading from STDIN\n" }
- while ($error = <>) {
+ while (defined ($error = <>)) {
splainthis($error) || print THITHER $error;
}
exit;
diff --git a/lib/ftp.pl b/lib/ftp.pl
index bfddcb8837..9528360da2 100644
--- a/lib/ftp.pl
+++ b/lib/ftp.pl
@@ -140,7 +140,7 @@ $real_site = "";
$ftp_show = 0;
sub ftp'debug
{
- $ftp_show = @_[0];
+ $ftp_show = $_[0];
# if( $ftp_show ){
# print STDERR "ftp debugging on\n";
# }
@@ -148,7 +148,7 @@ sub ftp'debug
sub ftp'set_timeout
{
- $timeout = @_[0];
+ $timeout = $_[0];
$timeout_open = $timeout;
$timeout_read = 20 * $timeout;
if( $ftp_show ){
diff --git a/lib/termcap.pl b/lib/termcap.pl
index c36575aa45..37313432fd 100644
--- a/lib/termcap.pl
+++ b/lib/termcap.pl
@@ -14,7 +14,7 @@ sub Tgetent {
local($TERMCAP,$_,$entry,$loop,$field);
warn "Tgetent: no ospeed set" unless $ospeed;
- foreach $key (keys(TC)) {
+ foreach $key (keys %TC) {
delete $TC{$key};
}
$TERM = $ENV{'TERM'} unless $TERM;
diff --git a/lib/validate.pl b/lib/validate.pl
index 21d0505ad4..ec4a04b543 100644
--- a/lib/validate.pl
+++ b/lib/validate.pl
@@ -91,11 +91,11 @@ sub valmess {
$mess =~ s/ does not / should not / ||
$mess =~ s/ not / /;
}
- print stderr $mess,"\n";
+ print STDERR $mess,"\n";
}
else {
$this =~ s/\$file/'$file'/g;
- print stderr "Can't do $this.\n";
+ print STDERR "Can't do $this.\n";
}
if ($disposition eq 'die') { exit 1; }
++$warnings;