summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-08-01 18:34:41 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-08-01 18:34:41 +0000
commit475342a6d5f74335e2bdfa64bd71f39289320205 (patch)
treefab7566350d719b51095369676644c6ec89a3cf0 /lib
parent4584684cd9409a5028e679de2f80cf97a3a728bd (diff)
downloadperl-475342a6d5f74335e2bdfa64bd71f39289320205.tar.gz
fix defined(@foo) encarpments
p4raw-id: //depot/perl@3848
Diffstat (limited to 'lib')
-rw-r--r--lib/CGI.pm10
-rw-r--r--lib/Dumpvalue.pm14
-rw-r--r--lib/dumpvar.pl14
3 files changed, 19 insertions, 19 deletions
diff --git a/lib/CGI.pm b/lib/CGI.pm
index b1319260fd..c0cb5fd518 100644
--- a/lib/CGI.pm
+++ b/lib/CGI.pm
@@ -355,7 +355,7 @@ sub init {
# if we get called more than once, we want to initialize
# ourselves from the original query (which may be gone
# if it was read from STDIN originally.)
- if (defined(@QUERY_PARAM) && !defined($initializer)) {
+ if (@QUERY_PARAM && !defined($initializer)) {
foreach (@QUERY_PARAM) {
$self->param('-name'=>$_,'-value'=>$QUERY_PARAM{$_});
}
@@ -841,7 +841,7 @@ END_OF_FUNC
sub keywords {
my($self,@values) = self_or_default(@_);
# If values is provided, then we set it.
- $self->{'keywords'}=[@values] if defined(@values);
+ $self->{'keywords'}=[@values] if @values;
my(@result) = defined($self->{'keywords'}) ? @{$self->{'keywords'}} : ();
@result;
}
@@ -1906,14 +1906,14 @@ sub _tableize {
# rearrange into a pretty table
$result = "<TABLE>";
my($row,$column);
- unshift(@$colheaders,'') if defined(@$colheaders) && defined(@$rowheaders);
- $result .= "<TR>" if defined(@{$colheaders});
+ unshift(@$colheaders,'') if @$colheaders && @$rowheaders;
+ $result .= "<TR>" if @$colheaders;
foreach (@{$colheaders}) {
$result .= "<TH>$_</TH>";
}
for ($row=0;$row<$rows;$row++) {
$result .= "<TR>";
- $result .= "<TH>$rowheaders->[$row]</TH>" if defined(@$rowheaders);
+ $result .= "<TH>$rowheaders->[$row]</TH>" if @$rowheaders;
for ($column=0;$column<$columns;$column++) {
$result .= "<TD>" . $elements[$column*$rows + $row] . "</TD>"
if defined($elements[$column*$rows + $row]);
diff --git a/lib/Dumpvalue.pm b/lib/Dumpvalue.pm
index 9c596ffc05..22a10af014 100644
--- a/lib/Dumpvalue.pm
+++ b/lib/Dumpvalue.pm
@@ -91,7 +91,7 @@ sub stringify {
{ no strict 'refs';
$_ = &{'overload::StrVal'}($_)
if $self->{bareStringify} and ref $_
- and defined %overload:: and defined &{'overload::StrVal'};
+ and %overload:: and defined &{'overload::StrVal'};
}
if ($tick eq 'auto') {
@@ -162,7 +162,7 @@ sub unwrap {
my $val = $v;
{ no strict 'refs';
$val = &{'overload::StrVal'}($v)
- if defined %overload:: and defined &{'overload::StrVal'};
+ if %overload:: and defined &{'overload::StrVal'};
}
($address) = $val =~ /(0x[0-9a-f]+)\)$/ ;
if (!$self->{dumpReused} && defined $address) {
@@ -324,12 +324,12 @@ sub dumpglob {
print( (' ' x $off) . "\$", &unctrl($key), " = " );
$self->DumpElem($stab, 3+$off);
}
- if (($key !~ /^_</ or $self->{dumpDBFiles}) and defined @stab) {
+ if (($key !~ /^_</ or $self->{dumpDBFiles}) and @stab) {
print( (' ' x $off) . "\@$key = (\n" );
$self->unwrap(\@stab,3+$off) ;
print( (' ' x $off) . ")\n" );
}
- if ($key ne "main::" && $key ne "DB::" && defined %stab
+ if ($key ne "main::" && $key ne "DB::" && %stab
&& ($self->{dumpPackages} or $key !~ /::$/)
&& ($key !~ /^_</ or $self->{dumpDBFiles})
&& !($package eq "Dumpvalue" and $key eq "stab")) {
@@ -361,7 +361,7 @@ sub dumpsub {
sub findsubs {
my $self = shift;
- return undef unless defined %DB::sub;
+ return undef unless %DB::sub;
my ($addr, $name, $loc);
while (($name, $loc) = each %DB::sub) {
$addr = \&$name;
@@ -444,9 +444,9 @@ sub globUsage { # glob ref, name
local *stab = *{$_[0]};
my $total = 0;
$total += $self->scalarUsage($stab) if defined $stab;
- $total += $self->arrayUsage(\@stab, $_[1]) if defined @stab;
+ $total += $self->arrayUsage(\@stab, $_[1]) if @stab;
$total += $self->hashUsage(\%stab, $_[1])
- if defined %stab and $_[1] ne "main::" and $_[1] ne "DB::";
+ if %stab and $_[1] ne "main::" and $_[1] ne "DB::";
#and !($package eq "Dumpvalue" and $key eq "stab"));
$total;
}
diff --git a/lib/dumpvar.pl b/lib/dumpvar.pl
index fb0bb2396f..f473c45bd3 100644
--- a/lib/dumpvar.pl
+++ b/lib/dumpvar.pl
@@ -53,7 +53,7 @@ sub stringify {
return $_ . "" if ref \$_ eq 'GLOB';
$_ = &{'overload::StrVal'}($_)
if $bareStringify and ref $_
- and defined %overload:: and defined &{'overload::StrVal'};
+ and %overload:: and defined &{'overload::StrVal'};
if ($tick eq 'auto') {
if (/[\000-\011\013-\037\177]/) {
@@ -125,7 +125,7 @@ sub unwrap {
if (ref $v) {
my $val = $v;
$val = &{'overload::StrVal'}($v)
- if defined %overload:: and defined &{'overload::StrVal'};
+ if %overload:: and defined &{'overload::StrVal'};
($address) = $val =~ /(0x[0-9a-f]+)\)$/ ;
if (!$dumpReused && defined $address) {
$address{$address}++ ;
@@ -289,12 +289,12 @@ sub dumpglob {
print( (' ' x $off) . "\$", &unctrl($key), " = " );
DumpElem $entry, 3+$off;
}
- if (($key !~ /^_</ or $dumpDBFiles) and defined @entry) {
+ if (($key !~ /^_</ or $dumpDBFiles) and @entry) {
print( (' ' x $off) . "\@$key = (\n" );
unwrap(\@entry,3+$off) ;
print( (' ' x $off) . ")\n" );
}
- if ($key ne "main::" && $key ne "DB::" && defined %entry
+ if ($key ne "main::" && $key ne "DB::" && %entry
&& ($dumpPackages or $key !~ /::$/)
&& ($key !~ /^_</ or $dumpDBFiles)
&& !($package eq "dumpvar" and $key eq "stab")) {
@@ -323,7 +323,7 @@ sub dumpsub {
}
sub findsubs {
- return undef unless defined %DB::sub;
+ return undef unless %DB::sub;
my ($addr, $name, $loc);
while (($name, $loc) = each %DB::sub) {
$addr = \&$name;
@@ -395,8 +395,8 @@ sub globUsage { # glob ref, name
local *name = *{$_[0]};
$total = 0;
$total += scalarUsage $name if defined $name;
- $total += arrayUsage \@name, $_[1] if defined @name;
- $total += hashUsage \%name, $_[1] if defined %name and $_[1] ne "main::"
+ $total += arrayUsage \@name, $_[1] if @name;
+ $total += hashUsage \%name, $_[1] if %name and $_[1] ne "main::"
and $_[1] ne "DB::"; #and !($package eq "dumpvar" and $key eq "stab"));
$total;
}