Double magic with substr
[p5sagit/p5-mst-13.2.git] / regen_lib.pl
index 7605271..89ac3f9 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 use strict;
-use vars qw($Is_W32 $Is_OS2 $Is_Cygwin $Is_NetWare $Needs_Write);
+use vars qw($Is_W32 $Is_OS2 $Is_Cygwin $Is_NetWare $Needs_Write $Verbose);
 use Config; # Remember, this is running using an existing perl
 use File::Compare;
 use Symbol;
@@ -17,6 +17,8 @@ if ($Is_NetWare) {
 
 $Needs_Write = $Is_OS2 || $Is_W32 || $Is_Cygwin || $Is_NetWare;
 
+@ARGV = grep { not($_ eq '-v' and $Verbose = 1) } @ARGV;
+
 sub safer_unlink {
   my @names = @_;
   my $cnt = 0;
@@ -44,7 +46,7 @@ sub rename_if_different {
   my ($from, $to) = @_;
 
   if (compare($from, $to) == 0) {
-      warn "no changes between '$from' & '$to'\n";
+      warn "no changes between '$from' & '$to'\n" if $Verbose;
       safer_unlink($from);
       return;
   }