This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
remove C<my $x if foo> construct from core modules
authorDave Mitchell <davem@fdisolutions.com>
Tue, 17 Feb 2004 21:52:08 +0000 (21:52 +0000)
committerDave Mitchell <davem@fdisolutions.com>
Tue, 17 Feb 2004 21:52:08 +0000 (21:52 +0000)
p4raw-id: //depot/perl@22322

12 files changed:
ext/B/B/Deparse.pm
ext/IO/lib/IO/Handle.pm
ext/IO/lib/IO/Pipe.pm
lib/ExtUtils/Liblist/Kid.pm
lib/ExtUtils/MM_NW5.pm
lib/ExtUtils/MM_Win95.pm
lib/Net/NNTP.pm
lib/Net/POP3.pm
lib/Net/SMTP.pm
lib/Pod/Parser.pm
lib/Test/Harness.pm
utils/h2xs.PL

index 67c61b7..21a3379 100644 (file)
@@ -1086,7 +1086,8 @@ sub lineseq {
     my $limit_seq;
     if (defined $root) {
        $limit_seq = $out_seq;
-       my $nseq = $self->find_scope_st($root->sibling) if ${$root->sibling};
+       my $nseq;
+       $nseq = $self->find_scope_st($root->sibling) if ${$root->sibling};
        $limit_seq = $nseq if !defined($limit_seq)
                           or defined($nseq) && $nseq < $limit_seq;
     }
index 50d391f..0c65de6 100644 (file)
@@ -494,42 +494,47 @@ sub input_record_separator {
 
 sub input_line_number {
     local $.;
-    my $tell = tell qualify($_[0], caller) if ref($_[0]);
+    () = tell qualify($_[0], caller) if ref($_[0]);
     my $prev = $.;
     $. = $_[1] if @_ > 1;
     $prev;
 }
 
 sub format_page_number {
-    my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]);
+    my $old;
+    $old = new SelectSaver qualify($_[0], caller) if ref($_[0]);
     my $prev = $%;
     $% = $_[1] if @_ > 1;
     $prev;
 }
 
 sub format_lines_per_page {
-    my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]);
+    my $old;
+    $old = new SelectSaver qualify($_[0], caller) if ref($_[0]);
     my $prev = $=;
     $= = $_[1] if @_ > 1;
     $prev;
 }
 
 sub format_lines_left {
-    my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]);
+    my $old;
+    $old = new SelectSaver qualify($_[0], caller) if ref($_[0]);
     my $prev = $-;
     $- = $_[1] if @_ > 1;
     $prev;
 }
 
 sub format_name {
-    my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]);
+    my $old;
+    $old = new SelectSaver qualify($_[0], caller) if ref($_[0]);
     my $prev = $~;
     $~ = qualify($_[1], caller) if @_ > 1;
     $prev;
 }
 
 sub format_top_name {
-    my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]);
+    my $old;
+    $old = new SelectSaver qualify($_[0], caller) if ref($_[0]);
     my $prev = $^;
     $^ = qualify($_[1], caller) if @_ > 1;
     $prev;
@@ -604,7 +609,8 @@ sub constant {
 
 sub printflush {
     my $io = shift;
-    my $old = new SelectSaver qualify($io, caller) if ref($io);
+    my $old;
+    $old = new SelectSaver qualify($io, caller) if ref($io);
     local $| = 1;
     if(ref($io)) {
         print $io @_;
index c70adfe..d368500 100644 (file)
@@ -98,7 +98,8 @@ sub reader {
        unless(ref($me) || ref($me = $me->new));
 
     my $fh  = ${*$me}[0];
-    my $pid = $me->_doit(0, $fh, @_)
+    my $pid;
+    $pid = $me->_doit(0, $fh, @_)
         if(@_);
 
     close ${*$me}[1];
@@ -121,7 +122,8 @@ sub writer {
        unless(ref($me) || ref($me = $me->new));
 
     my $fh  = ${*$me}[1];
-    my $pid = $me->_doit(1, $fh, @_)
+    my $pid;
+    $pid = $me->_doit(1, $fh, @_)
         if(@_);
 
     close ${*$me}[0];
index e3c7a1f..d67aa01 100644 (file)
@@ -227,9 +227,9 @@ sub _win32_ext {
     return ("", "", "", "", ($give_libs ? [] : ())) unless $potential_libs;
 
     my $cc             = $Config{cc};
-    my $VC             = 1 if $cc =~ /^cl/i;
-    my $BC             = 1 if $cc =~ /^bcc/i;
-    my $GC             = 1 if $cc =~ /^gcc/i;
+    my $VC             = $cc =~ /^cl/i;
+    my $BC             = $cc =~ /^bcc/i;
+    my $GC             = $cc =~ /^gcc/i;
     my $so             = $Config{'so'};
     my $libs           = $Config{'perllibs'};
     my $libpth         = $Config{'libpth'};
index 4e626cc..ca856df 100644 (file)
@@ -32,9 +32,9 @@ use ExtUtils::MakeMaker qw( &neatvalue );
 
 $ENV{EMXSHELL} = 'sh'; # to run `commands`
 
-my $BORLAND  = 1 if $Config{'cc'} =~ /^bcc/i;
-my $GCC      = 1 if $Config{'cc'} =~ /^gcc/i;
-my $DMAKE    = 1 if $Config{'make'} =~ /^dmake/i;
+my $BORLAND  = $Config{'cc'} =~ /^bcc/i;
+my $GCC      = $Config{'cc'} =~ /^gcc/i;
+my $DMAKE    = $Config{'make'} =~ /^dmake/i;
 
 
 =item os_flavor
index 13b1123..fe3c170 100644 (file)
@@ -6,9 +6,9 @@ $VERSION = 0.03;
 require ExtUtils::MM_Win32;
 @ISA = qw(ExtUtils::MM_Win32);
 
-use Config;\r
-my $DMAKE = 1 if $Config{'make'} =~ /^dmake/i;
-my $NMAKE = 1 if $Config{'make'} =~ /^nmake/i;
+use Config;
+my $DMAKE = $Config{'make'} =~ /^dmake/i;
+my $NMAKE = $Config{'make'} =~ /^nmake/i;
 
 
 =head1 NAME
index 79261f8..acf2bf1 100644 (file)
@@ -21,7 +21,8 @@ sub new
 {
  my $self = shift;
  my $type = ref($self) || $self;
- my $host = shift if @_ % 2;
+ my $host;
+ $host = shift if @_ % 2;
  my %arg  = @_;
  my $obj;
 
index 7cd44ef..01b0bb8 100644 (file)
@@ -21,7 +21,8 @@ sub new
 {
  my $self = shift;
  my $type = ref($self) || $self;
- my $host = shift if @_ % 2;
+ my $host;
+ $host = shift if @_ % 2;
  my %arg  = @_; 
  my $hosts = defined $host ? [ $host ] : $NetConfig{pop3_hosts};
  my $obj;
index be64037..424854e 100644 (file)
@@ -24,7 +24,8 @@ sub new
 {
  my $self = shift;
  my $type = ref($self) || $self;
- my $host = shift if @_ % 2;
+ my $host;
+ $host = shift if @_ % 2;
  my %arg  = @_; 
  my $hosts = defined $host ? $host : $NetConfig{smtp_hosts};
  my $obj;
index d12e016..653342e 100644 (file)
@@ -1155,7 +1155,8 @@ sub parse_from_file {
     my $self = shift;
     my %opts = (ref $_[0] eq 'HASH') ? %{ shift() } : ();
     my ($infile, $outfile) = @_;
-    my ($in_fh,  $out_fh) = (gensym, gensym)  if ($] < 5.6);
+    my ($in_fh,  $out_fh);
+    ($in_fh,  $out_fh) = (gensym, gensym)  if ($] < 5.6);
     my ($close_input, $close_output) = (0, 0);
     local *myData = $self;
     local $_;
index 6cd8b9e..35ceaaa 100644 (file)
@@ -463,7 +463,8 @@ sub _run_all_tests {
                 bench    => 0,
                );
 
-    my @dir_files = _globdir $Files_In_Dir if defined $Files_In_Dir;
+    my @dir_files;
+    @dir_files = _globdir $Files_In_Dir if defined $Files_In_Dir;
     my $t_start = new Benchmark;
 
     my $width = _leader_width(@tests);
index 0f47395..5d27e67 100644 (file)
@@ -701,7 +701,8 @@ $opt_c = $opt_f = 1 if $opt_X;
 
 $opt_t ||= 'IV';
 
-my %const_xsub = map { $_,1 } split(/,+/, $opt_s) if $opt_s;
+my %const_xsub;
+%const_xsub = map { $_,1 } split(/,+/, $opt_s) if $opt_s;
 
 my $extralibs = '';
 
@@ -1307,7 +1308,8 @@ if ($opt_x && $opt_a) {
 my $licence_hash = $licence;
 $licence_hash =~ s/^/#/gm;
 
-my $pod = <<"END" unless $opt_P;
+my $pod;
+$pod = <<"END" unless $opt_P;
 ## Below is stub documentation for your module. You'd better edit it!
 #
 #=head1 NAME