{
no strict 'refs';
$unused_sub_packages{$package} = 1;
- if (defined(@{$package.'::ISA'}))
+ if (@{$package.'::ISA'})
{
foreach my $isa (@{$package.'::ISA'})
{
# 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{$_});
}
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;
}
# 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]);
{ 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') {
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) {
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")) {
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;
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;
}
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]/) {
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}++ ;
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")) {
}
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;
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;
}
# perl4 prints:
# perl5 dies: hash %h defined
+Perl will now generate a warning when it sees defined(@a) and
+defined(%h).
+
=item * (Globs)
glob assignment from variable to variable will fail if the assigned