diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CGI.pm | 10 | ||||
-rw-r--r-- | lib/Dumpvalue.pm | 14 | ||||
-rw-r--r-- | lib/ExtUtils/MM_Cygwin.pm | 2 | ||||
-rw-r--r-- | lib/ExtUtils/MM_OS2.pm | 10 | ||||
-rw-r--r-- | lib/ExtUtils/Mksymlists.pm | 9 | ||||
-rw-r--r-- | lib/File/Spec/Unix.pm | 2 | ||||
-rw-r--r-- | lib/dumpvar.pl | 14 |
7 files changed, 34 insertions, 27 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/ExtUtils/MM_Cygwin.pm b/lib/ExtUtils/MM_Cygwin.pm index df4ae5983a..7a92290664 100644 --- a/lib/ExtUtils/MM_Cygwin.pm +++ b/lib/ExtUtils/MM_Cygwin.pm @@ -24,7 +24,7 @@ sub cflags { / *= */ and $self->{$`} = $'; }; $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true'); - $self->{CCFLAGS} .= " -DCYGWIN32" unless ($self->{CCFLAGS} =~ /\-DCYGWIN32/); + $self->{CCFLAGS} .= " -DCYGWIN" unless ($self->{CCFLAGS} =~ /\-DCYGWIN/); return $self->{CFLAGS} = qq{ CCFLAGS = $self->{CCFLAGS} diff --git a/lib/ExtUtils/MM_OS2.pm b/lib/ExtUtils/MM_OS2.pm index 5d6034ce34..430235a0aa 100644 --- a/lib/ExtUtils/MM_OS2.pm +++ b/lib/ExtUtils/MM_OS2.pm @@ -25,13 +25,13 @@ sub dlsyms { $self->{BASEEXT}.def: Makefile.PL ", ' $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e \'use ExtUtils::Mksymlists; \\ - Mksymlists("NAME" => "', $self->{NAME}, - '", "DLBASE" => "',$self->{DLBASE}, - '", "DL_FUNCS" => ',neatvalue($funcs), + Mksymlists("NAME" => "$(NAME)", "DLBASE" => "$(DLBASE)", ', + '"VERSION" => "$(VERSION)", "DISTNAME" => "$(DISTNAME)", ', + '"INSTALLDIRS" => "$(INSTALLDIRS)", ', + '"DL_FUNCS" => ',neatvalue($funcs), ', "FUNCLIST" => ',neatvalue($funclist), ', "IMPORTS" => ',neatvalue($imports), - ', "VERSION" => "',$self->{VERSION}, - '", "DL_VARS" => ', neatvalue($vars), ');\' + ', "DL_VARS" => ', neatvalue($vars), ');\' '); } if (%{$self->{IMPORTS}}) { diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm index 76535d9386..cfc1e7dff8 100644 --- a/lib/ExtUtils/Mksymlists.pm +++ b/lib/ExtUtils/Mksymlists.pm @@ -76,12 +76,19 @@ sub _write_os2 { ($data->{DLBASE} = $data->{NAME}) =~ s/.*:://; $data->{DLBASE} = substr($data->{DLBASE},0,7) . '_'; } + my $distname = $data->{DISTNAME} || $data->{NAME}; + $distname = "Distribution $distname"; + my $comment = "Perl (v$]$threaded) module $data->{NAME}"; + if ($data->{INSTALLDIRS} and $data->{INSTALLDIRS} eq 'perl') { + $distname = 'perl5-porters@perl.org'; + $comment = "Core $comment"; + } rename "$data->{FILE}.def", "$data->{FILE}_def.old"; open(DEF,">$data->{FILE}.def") or croak("Can't create $data->{FILE}.def: $!\n"); print DEF "LIBRARY '$data->{DLBASE}' INITINSTANCE TERMINSTANCE\n"; - print DEF "DESCRIPTION 'Perl (v$]$threaded) module $data->{NAME} v$data->{VERSION}'\n"; + print DEF "DESCRIPTION '\@#$distname:$data->{VERSION}#\@ $comment'\n"; print DEF "CODE LOADONCALL\n"; print DEF "DATA LOADONCALL NONSHARED MULTIPLE\n"; print DEF "EXPORTS\n "; diff --git a/lib/File/Spec/Unix.pm b/lib/File/Spec/Unix.pm index e33ecb7b36..87ad643fe2 100644 --- a/lib/File/Spec/Unix.pm +++ b/lib/File/Spec/Unix.pm @@ -41,7 +41,7 @@ ricochet (some scripts depend on it). sub canonpath { my ($self,$path,$reduce_ricochet) = @_; - $path =~ s|/+|/|g; # xx////xx -> xx/xx + $path =~ s|/+|/|g unless($^O =~ /cygwin/); # xx////xx -> xx/xx $path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx $path =~ s|^(\./)+|| unless $path eq "./"; # ./xx -> xx $path =~ s|^/(\.\./)+|/|; # /../../xx -> xx 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; } |