[interchange-cvs] interchange - heins modified 21 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Sat Apr 30 11:09:59 EDT 2005


User:      heins
Date:      2005-04-30 15:09:59 GMT
Modified:  lib/Vend Config.pm Data.pm DbSearch.pm Dispatch.pm File.pm
Modified:           Form.pm Interpolate.pm Menu.pm Order.pm Parse.pm
Modified:           Parser.pm RefSearch.pm SQL_Parser.pm Scan.pm
Modified:           Search.pm TextSearch.pm UserDB.pm Util.pm
Modified:  lib/Vend/Table Common.pm DBI.pm Editor.pm
Log:
* We had been running without warnings so long, we had gotten a bit sloppy
  in our code in some places.

  Because we do lots of uninitialized hash member stuff with arrays
  of fields and $opt, it is basically unreasonable for us to run with
  the "use of uninitialized variable" warnings. Because we do a fair
  amount of numerical comparisons on empty string values, it seemed
  unreasonable to run with "string value in numeric gt" enabled.

  Also, because Safe, HTML::Entities, and some other modules have
  these checks enabled, page code is bound to have warnings issued
  no matter what you do.

  It seems better to run with some warnings enabled so that we can
  catch bad code practice.

  So I have made the code run without warnings prior to and after
  interpolate_html(), and turned off warnings by default in the
  page code.

  If it is desirable to turn on warnings for pages, you can use
  [pragma perl_warnings_in_page] and see warnings for that page
  (or by default if you put in catalog.cfg).

* In general these changes are:

	 no warnings qw(uninitialized numeric);

  in most pages.

* Add $::Pragma->{perl_warnings_in_page}.

* Remove defined checks when simple set tests will do.

* Streamline some code.

Revision  Changes    Path
2.169     +3 -2      interchange/lib/Vend/Config.pm


rev 2.169, prev_rev 2.168
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.168
retrieving revision 2.169
diff -u -r2.168 -r2.169
--- Config.pm	28 Apr 2005 01:54:44 -0000	2.168
+++ Config.pm	30 Apr 2005 15:09:57 -0000	2.169
@@ -1,6 +1,6 @@
 # Vend::Config - Configure Interchange
 #
-# $Id: Config.pm,v 2.168 2005/04/28 01:54:44 mheins Exp $
+# $Id: Config.pm,v 2.169 2005/04/30 15:09:57 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -33,6 +33,7 @@
 @EXPORT_OK	= qw( get_catalog_default get_global_default parse_time parse_database);
 
 use strict;
+no warnings qw(uninitialized numeric);
 use vars qw(
 			$VERSION $C
 			@Locale_directives_ary @Locale_directives_scalar
@@ -49,7 +50,7 @@
 use Vend::File;
 use Vend::Data;
 
-$VERSION = substr(q$Revision: 2.168 $, 10);
+$VERSION = substr(q$Revision: 2.169 $, 10);
 
 my %CDname;
 my %CPname;



2.48      +2 -1      interchange/lib/Vend/Data.pm


rev 2.48, prev_rev 2.47
Index: Data.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Data.pm,v
retrieving revision 2.47
retrieving revision 2.48
diff -u -r2.47 -r2.48
--- Data.pm	28 Apr 2005 01:54:44 -0000	2.47
+++ Data.pm	30 Apr 2005 15:09:58 -0000	2.48
@@ -1,6 +1,6 @@
 # Vend::Data - Interchange databases
 #
-# $Id: Data.pm,v 2.47 2005/04/28 01:54:44 mheins Exp $
+# $Id: Data.pm,v 2.48 2005/04/30 15:09:58 mheins Exp $
 # 
 # Copyright (C) 2002-2004 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -62,6 +62,7 @@
 @EXPORT_OK = qw(update_productbase column_index);
 
 use strict;
+no warnings qw(uninitialized numeric);
 use File::Basename;
 use Vend::Util;
 use Vend::Interpolate;



2.20      +4 -3      interchange/lib/Vend/DbSearch.pm


rev 2.20, prev_rev 2.19
Index: DbSearch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/DbSearch.pm,v
retrieving revision 2.19
retrieving revision 2.20
diff -u -r2.19 -r2.20
--- DbSearch.pm	6 Jul 2003 17:06:09 -0000	2.19
+++ DbSearch.pm	30 Apr 2005 15:09:58 -0000	2.20
@@ -1,6 +1,6 @@
 # Vend::DbSearch - Search indexes with Interchange
 #
-# $Id: DbSearch.pm,v 2.19 2003/07/06 17:06:09 mheins Exp $
+# $Id: DbSearch.pm,v 2.20 2005/04/30 15:09:58 mheins Exp $
 #
 # Adapted for use with Interchange from Search::TextSearch
 #
@@ -27,10 +27,11 @@
 
 @ISA = qw(Vend::Search);
 
-$VERSION = substr(q$Revision: 2.19 $, 10);
+$VERSION = substr(q$Revision: 2.20 $, 10);
 
 use Search::Dict;
 use strict;
+no warnings qw(uninitialized numeric);
 
 sub array {
 	my ($s, $opt) = @_;
@@ -310,7 +311,7 @@
 		@out = grep ! $seen{$_->[0]}++, @out;
 	}
 
-	if($s->{mv_max_matches} > 0) {
+	if($s->{mv_max_matches} and $s->{mv_max_matches} > 0) {
 		splice @out, $s->{mv_max_matches};
 	}
 



1.52      +5 -2      interchange/lib/Vend/Dispatch.pm


rev 1.52, prev_rev 1.51
Index: Dispatch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Dispatch.pm,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- Dispatch.pm	28 Apr 2005 01:54:44 -0000	1.51
+++ Dispatch.pm	30 Apr 2005 15:09:58 -0000	1.52
@@ -1,6 +1,6 @@
 # Vend::Dispatch - Handle Interchange page requests
 #
-# $Id: Dispatch.pm,v 1.51 2005/04/28 01:54:44 mheins Exp $
+# $Id: Dispatch.pm,v 1.52 2005/04/30 15:09:58 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 2002 Mike Heins <mike at perusion.net>
@@ -26,7 +26,7 @@
 package Vend::Dispatch;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.51 $, 10);
+$VERSION = substr(q$Revision: 1.52 $, 10);
 
 use POSIX qw(strftime);
 use Vend::Util;
@@ -39,6 +39,7 @@
 use Vend::Page;
 use Vend::UserDB;
 use Vend::CounterFile;
+no warnings qw(uninitialized numeric);
 
 # TRACK
 use Vend::Track;
@@ -60,6 +61,8 @@
 				update_user
 				update_values
 			);
+
+use strict;
 
 my $H;
 sub http {



2.18      +3 -3      interchange/lib/Vend/File.pm


rev 2.18, prev_rev 2.17
Index: File.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/File.pm,v
retrieving revision 2.17
retrieving revision 2.18
diff -u -r2.17 -r2.18
--- File.pm	27 Apr 2005 19:26:39 -0000	2.17
+++ File.pm	30 Apr 2005 15:09:58 -0000	2.18
@@ -1,6 +1,6 @@
 # Vend::File - Interchange file functions
 #
-# $Id: File.pm,v 2.17 2005/04/27 19:26:39 mheins Exp $
+# $Id: File.pm,v 2.18 2005/04/30 15:09:58 mheins Exp $
 # 
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -53,7 +53,7 @@
 use Vend::Util;
 use subs qw(logError logGlobal);
 use vars qw($VERSION @EXPORT @EXPORT_OK $errstr);
-$VERSION = substr(q$Revision: 2.17 $, 10);
+$VERSION = substr(q$Revision: 2.18 $, 10);
 
 sub writefile {
     my($file, $data, $opt) = @_;
@@ -539,7 +539,7 @@
 	ic_scratch => sub {
 					my ($fn, $checkpath, $write, $sub, $compare) = @_;
 					my $false = $sub =~ s/^!\s*//;
-					my $status	= length($compare)
+					my $status	= defined $compare && length($compare)
 								? ($::Scratch->{$sub} eq $compare)
 								: ($::Scratch->{$sub});
 					return ! $false if $status;



2.59      +5 -6      interchange/lib/Vend/Form.pm


rev 2.59, prev_rev 2.58
Index: Form.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Form.pm,v
retrieving revision 2.58
retrieving revision 2.59
diff -u -r2.58 -r2.59
--- Form.pm	28 Apr 2005 01:54:44 -0000	2.58
+++ Form.pm	30 Apr 2005 15:09:58 -0000	2.59
@@ -1,6 +1,6 @@
 # Vend::Form - Generate Form widgets
 # 
-# $Id: Form.pm,v 2.58 2005/04/28 01:54:44 mheins Exp $
+# $Id: Form.pm,v 2.59 2005/04/30 15:09:58 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -31,6 +31,7 @@
 use Vend::Util;
 use Vend::Tags;
 use strict;
+no warnings qw(uninitialized numeric);
 use POSIX qw{strftime};
 
 use vars qw/@ISA @EXPORT @EXPORT_OK $VERSION %Template %ExtraMeta/;
@@ -38,7 +39,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.58 $, 10);
+$VERSION = substr(q$Revision: 2.59 $, 10);
 
 @EXPORT = qw (
 	display
@@ -238,6 +239,7 @@
 sub attr_list {
 	my ($body, $hash) = @_;
 	return $body unless ref($hash) eq 'HASH';
+
 	$body =~ s!\{([A-Z_]+)\}!$hash->{lc $1}!g;
 	$body =~ s!\{([A-Z_]+)\|($Some)\}!$hash->{lc $1} || $2!eg;
 	$body =~ s!\{([A-Z_]+)\s+($Some)\}! $hash->{lc $1} ? $2 : ''!eg;
@@ -788,9 +790,7 @@
 			$value =~ s/\*$// and $select = 1;
 		}
 
-		if (defined $default) {
-			$select = '';
-		}
+		$select = '' if defined $default;
 
 		my $extra = '';
 		my $attr = {};
@@ -1360,7 +1360,6 @@
 	if(my $c = $opt->{check}) {
 		$c = "$opt->{name}=$c" unless $c =~ /=/;
 		HTML::Entities::encode($c);
-		no warnings;
 		$opt->{append} .= qq{<input type=hidden name="mv_individual_profile" value="$c">};
 	}
 



2.243     +49 -43    interchange/lib/Vend/Interpolate.pm


rev 2.243, prev_rev 2.242
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.242
retrieving revision 2.243
diff -u -r2.242 -r2.243
--- Interpolate.pm	28 Apr 2005 01:54:44 -0000	2.242
+++ Interpolate.pm	30 Apr 2005 15:09:58 -0000	2.243
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 # 
-# $Id: Interpolate.pm,v 2.242 2005/04/28 01:54:44 mheins Exp $
+# $Id: Interpolate.pm,v 2.243 2005/04/30 15:09:58 mheins Exp $
 #
 # Copyright (C) 2002-2005 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -28,7 +28,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.242 $, 10);
+$VERSION = substr(q$Revision: 2.243 $, 10);
 
 @EXPORT = qw (
 
@@ -89,6 +89,9 @@
 	};
 }
 
+# We generally know when we are testing these things, but be careful
+no warnings qw(uninitialized numeric);
+
 use strict;
 use Vend::Util;
 use Vend::File;
@@ -642,6 +645,8 @@
 	my ($name, @post);
 	my ($bit, %post);
 
+	local($^W);
+
 	my $toplevel;
 	if(defined $Vend::PageInit and ! $Vend::PageInit) {
 		defined $::Variable->{MV_AUTOLOAD}
@@ -653,6 +658,8 @@
 	vars_and_comments(\$html)
 		unless $opt and $opt->{onfly};
 
+	$^W = 1 if $::Pragma->{perl_warnings_in_page};
+
     # Returns, could be recursive
 	my $parse = new Vend::Parse $wantref;
 	$parse->parse($html);
@@ -1550,7 +1557,7 @@
 
 #::logDebug("tag_perl: tables=$tables opt=" . uneval($opt) . " body=$body");
 #::logDebug("tag_perl initialized=$Vend::Calc_initialized: carts=" . uneval($::Carts));
-	if($opt->{subs} || (defined $opt->{arg} and $opt->{arg} =~ /\bsub\b/)) {
+	if($opt->{subs} or $opt->{arg} =~ /\bsub\b/) {
 		no strict 'refs';
 		for(keys %{$Global::GlobalSub}) {
 #::logDebug("tag_perl share subs: GlobalSub=$_");
@@ -1918,7 +1925,7 @@
 
 	$file = ">$file" if $opt->{create};
 
-	unless($opt->{process} =~ /\bnostrip\b/i) {
+	unless($opt->{process} and $opt->{process} =~ /\bnostrip\b/i) {
 		$data =~ s/\r\n/\n/g;
 		$data =~ s/^\s+//;
 		$data =~ s/\s+$/\n/;
@@ -1929,28 +1936,31 @@
 		next unless defined $opt->{$_};
 		$opt->{$_} = $ready_safe->reval(qq{$opt->{$_}});
 	}
-	if($opt->{type} =~ /^text/) {
-		$status = Vend::Util::writefile($file, $data, $opt);
-	}
-	elsif($opt->{type} =~ /^\s*quot/) {
-		$record_delim = $opt->{record_delim} || "\n";
-		@lines = split /$record_delim/, $data;
-		for(@lines) {
-			@fields = Text::ParseWords::shellwords $_;
-			$status = logData($file, @fields)
-				or last;
-		}
-	}
-	elsif($opt->{type} =~ /^(?:error|debug)/) {
-		if ($opt->{file}) {
-			$data = format_log_msg($data) unless $data =~ s/^\\//;;
+
+	if($opt->{type}) {
+		if($opt->{type} =~ /^text/) {
 			$status = Vend::Util::writefile($file, $data, $opt);
 		}
-		elsif ($opt->{type} =~ /^debug/) {
-			$status = Vend::Util::logDebug($data);
-		}
-		else {
-			$status = Vend::Util::logError($data);
+		elsif($opt->{type} =~ /^\s*quot/) {
+			$record_delim = $opt->{record_delim} || "\n";
+			@lines = split /$record_delim/, $data;
+			for(@lines) {
+				@fields = Text::ParseWords::shellwords $_;
+				$status = logData($file, @fields)
+					or last;
+			}
+		}
+		elsif($opt->{type} =~ /^(?:error|debug)/) {
+			if ($opt->{file}) {
+				$data = format_log_msg($data) unless $data =~ s/^\\//;;
+				$status = Vend::Util::writefile($file, $data, $opt);
+			}
+			elsif ($opt->{type} =~ /^debug/) {
+				$status = Vend::Util::logDebug($data);
+			}
+			else {
+				$status = Vend::Util::logError($data);
+			}
 		}
 	}
 	else {
@@ -2899,7 +2909,7 @@
 
 	@codes = sort {&$code($a, $b)} @$list;
 
-	if(defined $start and $start > 1) {
+	if($start > 1) {
 		splice(@codes, 0, $start - 1);
 	}
 
@@ -2985,7 +2995,7 @@
 
 	@codes = sort {&$code($a,$b)} @$list;
 
-	if(defined $start and $start > 1) {
+	if($start > 1) {
 		splice(@codes, 0, $start - 1);
 	}
 
@@ -3038,10 +3048,10 @@
 sub tag_search_region {
 	my($params, $opt, $text) = @_;
 	$opt->{search} = $params if $params;
-	$opt->{prefix}      = 'item'           if ! defined $opt->{prefix};
-	$opt->{list_prefix} = 'search[-_]list' if ! defined $opt->{list_prefix};
+	$opt->{prefix}      ||= 'item';
+	$opt->{list_prefix} ||= 'search[-_]list';
 # LEGACY
-	list_compat($opt->{prefix}, \$text);
+	list_compat($opt->{prefix}, \$text) if $text;
 # END LEGACY
 	return region($opt, $text);
 }
@@ -3392,6 +3402,7 @@
 	my ($row, $table, $tabRE);
 	my $done;
 	my $prefix;
+
 	if(defined $Prefix) {
 		$prefix = $Prefix;
 		undef $Prefix;
@@ -3465,7 +3476,7 @@
 	return '' if ! $obj;
 
 	my $ary = $obj->{mv_results};
-	return if (! $ary or ! ref $ary or ! defined $ary->[0]);
+	return '' if (! $ary or ! ref $ary or ! defined $ary->[0]);
 	
 	my $save_unsafe = $MVSAFE::Unsafe || '';
 	$MVSAFE::Unsafe = 1;
@@ -3598,6 +3609,7 @@
 
 sub tag_attr_list {
 	my ($body, $hash, $ucase) = @_;
+
 	if(! ref $hash) {
 		$hash = string_to_ref($hash);
 		if($@) {
@@ -3924,9 +3936,6 @@
 		$inc ||= $::Values->{mv_item_alternate} || 2;
 	}
 
-	## We know we are going to do numeric compares on strings, so no warnings
-	no warnings;
-
 	return $count % $inc if $inc >= 1;
 
 	my $status;
@@ -4215,10 +4224,6 @@
 	# undef the $Row object, as it should only be set as needed by [PREFIX-calc]
 	undef $Row;
 
-	## We can't control defined state of these hash members, so we will
-	## kill warnings
-	no warnings;
-
 	for ( ; $i <= $end; $i++, $count++) {
 		$item = $hash->[$i];
 		$item->{mv_ip} = $opt->{reverse} ? ($end - $i) : $i;
@@ -4583,11 +4588,11 @@
 
 	my $lprefix;
 	my $mprefix;
-	if(defined $opt->{list_prefix}) {
+	if($opt->{list_prefix}) {
 		$lprefix = $opt->{list_prefix};
 		$mprefix = "(?:$opt->{list_prefix}-)?";
 	}
-	elsif (defined $opt->{prefix}) {
+	elsif ($opt->{prefix}) {
 		$lprefix = "(?:$opt->{prefix}-)?list";
 		$mprefix = "(?:$opt->{prefix}-)?";
 	}
@@ -4643,6 +4648,7 @@
 				!
 					$obj->{matches} > 0 ? '' : opt_region(0,0,1,$2,$opt)
 				!xige;
+
 	$page =~ s:\[($lprefix)\]($Some)\[/\1\]:labeled_list($opt,$2,$obj):ige
 		or $page = labeled_list($opt,$page,$obj);
 #::logDebug("past labeled_list");
@@ -4656,9 +4662,8 @@
 	my $fn;
 	my @rows;
 
-	$opt->{prefix} = 'loop' unless defined $opt->{prefix};
-	$opt->{label}  =  "loop" . ++$::Instance->{List_it} . $Global::Variable->{MV_PAGE}
-						unless defined $opt->{label};
+	$opt->{prefix} ||= 'loop';
+	$opt->{label}  ||= "loop" . ++$::Instance->{List_it} . $Global::Variable->{MV_PAGE};
 
 #::logDebug("list is: " . uneval($list) );
 
@@ -4879,8 +4884,9 @@
 	$Vend::Track->view_product($code) if $Vend::Track;
 # END TRACK
 	
+	$opt->{prefix} ||= 'item';
 # LEGACY
-	list_compat($opt->{prefix}, \$page);
+	list_compat($opt->{prefix}, \$page) if $page;
 # END LEGACY
 
 	return labeled_list( {}, $page, { mv_results => [[$code]] });



2.43      +3 -2      interchange/lib/Vend/Menu.pm


rev 2.43, prev_rev 2.42
Index: Menu.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Menu.pm,v
retrieving revision 2.42
retrieving revision 2.43
diff -u -r2.42 -r2.43
--- Menu.pm	12 Apr 2005 15:14:39 -0000	2.42
+++ Menu.pm	30 Apr 2005 15:09:58 -0000	2.43
@@ -1,6 +1,6 @@
 # Vend::Menu - Interchange menu processing routines
 #
-# $Id: Menu.pm,v 2.42 2005/04/12 15:14:39 mheins Exp $
+# $Id: Menu.pm,v 2.43 2005/04/30 15:09:58 mheins Exp $
 #
 # Copyright (C) 2002 Mike Heins, <mike at perusion.net>
 #
@@ -21,10 +21,11 @@
 
 package Vend::Menu;
 
-$VERSION = substr(q$Revision: 2.42 $, 10);
+$VERSION = substr(q$Revision: 2.43 $, 10);
 
 use Vend::Util;
 use strict;
+no warnings qw(uninitialized numeric);
 
 my $indicated;
 my $last_line;



2.69      +3 -2      interchange/lib/Vend/Order.pm


rev 2.69, prev_rev 2.68
Index: Order.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Order.pm,v
retrieving revision 2.68
retrieving revision 2.69
diff -u -r2.68 -r2.69
--- Order.pm	5 Mar 2005 19:01:54 -0000	2.68
+++ Order.pm	30 Apr 2005 15:09:58 -0000	2.69
@@ -1,6 +1,6 @@
 # Vend::Order - Interchange order routing routines
 #
-# $Id: Order.pm,v 2.68 2005/03/05 19:01:54 mheins Exp $
+# $Id: Order.pm,v 2.69 2005/04/30 15:09:58 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -29,7 +29,7 @@
 package Vend::Order;
 require Exporter;
 
-$VERSION = substr(q$Revision: 2.68 $, 10);
+$VERSION = substr(q$Revision: 2.69 $, 10);
 
 @ISA = qw(Exporter);
 
@@ -58,6 +58,7 @@
 use Text::ParseWords;
 use Errno qw/:POSIX/;
 use strict;
+no warnings qw(uninitialized numeric);
 
 use autouse 'Vend::Error' => qw/do_lockout/;
 



2.32      +3 -8      interchange/lib/Vend/Parse.pm


rev 2.32, prev_rev 2.31
Index: Parse.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Parse.pm,v
retrieving revision 2.31
retrieving revision 2.32
diff -u -r2.31 -r2.32
--- Parse.pm	28 Apr 2005 01:54:44 -0000	2.31
+++ Parse.pm	30 Apr 2005 15:09:58 -0000	2.32
@@ -1,6 +1,6 @@
 # Vend::Parse - Parse Interchange tags
 # 
-# $Id: Parse.pm,v 2.31 2005/04/28 01:54:44 mheins Exp $
+# $Id: Parse.pm,v 2.32 2005/04/30 15:09:58 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -36,12 +36,13 @@
 
 @ISA = qw(Exporter Vend::Parser);
 
-$VERSION = substr(q$Revision: 2.31 $, 10);
+$VERSION = substr(q$Revision: 2.32 $, 10);
 
 @EXPORT = ();
 @EXPORT_OK = qw(find_matching_end);
 
 use strict;
+no warnings qw(uninitialized numeric);
 
 use vars qw($VERSION);
 
@@ -424,8 +425,6 @@
 		if defined $Vend::Cfg->{AdminSub}{$tag} and
 			($Vend::restricted or ! $Vend::admin);
 	
-	no warnings;
-
 	if (! defined $Routine{$tag}) {
         if (! $Alias{$tag}) {
             ::logError("Tag '$tag' not defined.");
@@ -776,10 +775,6 @@
 
 #::logDebug("output attr=$attr->{_output}");
 	$self->destination($attr->{_output}) if $attr->{_output};
-
-	## We can't control whether tags will return undef or not,
-	## so we turn off warnings
-	no warnings;
 
 	if($hasEndTag{$tag}) {
 		# Handle embedded tags, but only if interpolate is 



2.11      +3 -2      interchange/lib/Vend/Parser.pm


rev 2.11, prev_rev 2.10
Index: Parser.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Parser.pm,v
retrieving revision 2.10
retrieving revision 2.11
diff -u -r2.10 -r2.11
--- Parser.pm	18 Apr 2005 12:12:28 -0000	2.10
+++ Parser.pm	30 Apr 2005 15:09:58 -0000	2.11
@@ -1,6 +1,6 @@
 # Vend::Parser - Interchange parser class
 #
-# $Id: Parser.pm,v 2.10 2005/04/18 12:12:28 mheins Exp $
+# $Id: Parser.pm,v 2.11 2005/04/30 15:09:58 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1997-2002 Red Hat, Inc.
@@ -65,10 +65,11 @@
 package Vend::Parser;
 
 use strict;
+no warnings qw(uninitialized numeric);
 
 use HTML::Entities ();
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 2.10 $, 10);
+$VERSION = substr(q$Revision: 2.11 $, 10);
 
 
 sub new



2.8       +3 -2      interchange/lib/Vend/RefSearch.pm


rev 2.8, prev_rev 2.7
Index: RefSearch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/RefSearch.pm,v
retrieving revision 2.7
retrieving revision 2.8
diff -u -r2.7 -r2.8
--- RefSearch.pm	23 Jul 2004 02:48:58 -0000	2.7
+++ RefSearch.pm	30 Apr 2005 15:09:58 -0000	2.8
@@ -1,6 +1,6 @@
 # Vend::DbSearch - Search indexes with Interchange
 #
-# $Id: RefSearch.pm,v 2.7 2004/07/23 02:48:58 mheins Exp $
+# $Id: RefSearch.pm,v 2.8 2005/04/30 15:09:58 mheins Exp $
 #
 # Adapted for use with Interchange from Search::TextSearch
 #
@@ -27,9 +27,10 @@
 
 @ISA = qw(Vend::Search);
 
-$VERSION = substr(q$Revision: 2.7 $, 10);
+$VERSION = substr(q$Revision: 2.8 $, 10);
 
 use strict;
+no warnings qw(uninitialized numeric);
 
 sub array {
 	my ($s, $opt) = @_;



2.10      +3 -2      interchange/lib/Vend/SQL_Parser.pm


rev 2.10, prev_rev 2.9
Index: SQL_Parser.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/SQL_Parser.pm,v
retrieving revision 2.9
retrieving revision 2.10
diff -u -r2.9 -r2.10
--- SQL_Parser.pm	20 Feb 2004 01:10:27 -0000	2.9
+++ SQL_Parser.pm	30 Apr 2005 15:09:58 -0000	2.10
@@ -1,6 +1,6 @@
 # Vend::SQL_Parser - Interchange SQL parser class
 #
-# $Id: SQL_Parser.pm,v 2.9 2004/02/20 01:10:27 jon Exp $
+# $Id: SQL_Parser.pm,v 2.10 2005/04/30 15:09:58 mheins Exp $
 #
 # Copyright (C) 2003-2004 Interchange Development Group
 #
@@ -37,7 +37,8 @@
 use Vend::Util;
 use Text::ParseWords;
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 2.9 $, 10);
+no warnings qw(uninitialized numeric);
+$VERSION = substr(q$Revision: 2.10 $, 10);
 
 sub new {
 	my $class = shift;



2.30      +3 -2      interchange/lib/Vend/Scan.pm


rev 2.30, prev_rev 2.29
Index: Scan.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Scan.pm,v
retrieving revision 2.29
retrieving revision 2.30
diff -u -r2.29 -r2.30
--- Scan.pm	6 Mar 2005 04:16:24 -0000	2.29
+++ Scan.pm	30 Apr 2005 15:09:58 -0000	2.30
@@ -1,6 +1,6 @@
 # Vend::Scan - Prepare searches for Interchange
 #
-# $Id: Scan.pm,v 2.29 2005/03/06 04:16:24 mheins Exp $
+# $Id: Scan.pm,v 2.30 2005/04/30 15:09:58 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -30,9 +30,10 @@
 			perform_search
 			);
 
-$VERSION = substr(q$Revision: 2.29 $, 10);
+$VERSION = substr(q$Revision: 2.30 $, 10);
 
 use strict;
+no warnings qw(uninitialized numeric);
 use Vend::Util;
 use Vend::File;
 use Vend::SQL_Parser;



2.30      +3 -2      interchange/lib/Vend/Search.pm


rev 2.30, prev_rev 2.29
Index: Search.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Search.pm,v
retrieving revision 2.29
retrieving revision 2.30
diff -u -r2.29 -r2.30
--- Search.pm	21 Apr 2005 21:39:17 -0000	2.29
+++ Search.pm	30 Apr 2005 15:09:58 -0000	2.30
@@ -1,6 +1,6 @@
 # Vend::Search - Base class for search engines
 #
-# $Id: Search.pm,v 2.29 2005/04/21 21:39:17 mheins Exp $
+# $Id: Search.pm,v 2.30 2005/04/30 15:09:58 mheins Exp $
 #
 # Copyright (C) 2002-2004 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -22,9 +22,10 @@
 
 package Vend::Search;
 
-$VERSION = substr(q$Revision: 2.29 $, 10);
+$VERSION = substr(q$Revision: 2.30 $, 10);
 
 use strict;
+no warnings qw(uninitialized numeric);
 use vars qw($VERSION);
 
 sub new {



2.13      +3 -2      interchange/lib/Vend/TextSearch.pm


rev 2.13, prev_rev 2.12
Index: TextSearch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/TextSearch.pm,v
retrieving revision 2.12
retrieving revision 2.13
diff -u -r2.12 -r2.13
--- TextSearch.pm	18 Jun 2003 17:34:44 -0000	2.12
+++ TextSearch.pm	30 Apr 2005 15:09:58 -0000	2.13
@@ -1,6 +1,6 @@
 # Vend::TextSearch - Search indexes with Perl
 #
-# $Id: TextSearch.pm,v 2.12 2003/06/18 17:34:44 jon Exp $
+# $Id: TextSearch.pm,v 2.13 2005/04/30 15:09:58 mheins Exp $
 #
 # Adapted for use with Interchange from Search::TextSearch
 #
@@ -29,10 +29,11 @@
 use vars qw(@ISA);
 @ISA = qw(Vend::Search);
 
-$VERSION = substr(q$Revision: 2.12 $, 10);
+$VERSION = substr(q$Revision: 2.13 $, 10);
 
 use Search::Dict;
 use strict;
+no warnings qw(uninitialized numeric);
 
 sub array {
 	my ($s, $opt) = @_;



2.36      +4 -3      interchange/lib/Vend/UserDB.pm


rev 2.36, prev_rev 2.35
Index: UserDB.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/UserDB.pm,v
retrieving revision 2.35
retrieving revision 2.36
diff -u -r2.35 -r2.36
--- UserDB.pm	8 Apr 2005 02:46:41 -0000	2.35
+++ UserDB.pm	30 Apr 2005 15:09:58 -0000	2.36
@@ -1,6 +1,6 @@
 # Vend::UserDB - Interchange user database functions
 #
-# $Id: UserDB.pm,v 2.35 2005/04/08 02:46:41 jon Exp $
+# $Id: UserDB.pm,v 2.36 2005/04/30 15:09:58 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -17,7 +17,7 @@
 
 package Vend::UserDB;
 
-$VERSION = substr(q$Revision: 2.35 $, 10);
+$VERSION = substr(q$Revision: 2.36 $, 10);
 
 use vars qw!
 	$VERSION
@@ -30,6 +30,7 @@
 use Vend::Util;
 use Safe;
 use strict;
+no warnings qw(uninitialized numeric);
 
 my $ready = new Safe;
 
@@ -538,7 +539,7 @@
 	}
 
 	for(@fields) {
-		if(defined $ignore{$_}) {
+		if($ignore{$_}) {
 			$self->{PRESENT}->{$_} = 1;
 			next;
 		}



2.83      +3 -2      interchange/lib/Vend/Util.pm


rev 2.83, prev_rev 2.82
Index: Util.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Util.pm,v
retrieving revision 2.82
retrieving revision 2.83
diff -u -r2.82 -r2.83
--- Util.pm	21 Apr 2005 11:24:05 -0000	2.82
+++ Util.pm	30 Apr 2005 15:09:58 -0000	2.83
@@ -1,6 +1,6 @@
 # Vend::Util - Interchange utility functions
 #
-# $Id: Util.pm,v 2.82 2005/04/21 11:24:05 mheins Exp $
+# $Id: Util.pm,v 2.83 2005/04/30 15:09:58 mheins Exp $
 # 
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -78,6 +78,7 @@
 );
 
 use strict;
+no warnings qw(uninitialized numeric);
 use Config;
 use Fcntl;
 use Errno;
@@ -87,7 +88,7 @@
 use Vend::File;
 use subs qw(logError logGlobal);
 use vars qw($VERSION @EXPORT @EXPORT_OK);
-$VERSION = substr(q$Revision: 2.82 $, 10);
+$VERSION = substr(q$Revision: 2.83 $, 10);
 
 my $Eval_routine;
 my $Eval_routine_file;



2.40      +6 -3      interchange/lib/Vend/Table/Common.pm


rev 2.40, prev_rev 2.39
Index: Common.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/Common.pm,v
retrieving revision 2.39
retrieving revision 2.40
diff -u -r2.39 -r2.40
--- Common.pm	28 Apr 2005 01:56:28 -0000	2.39
+++ Common.pm	30 Apr 2005 15:09:59 -0000	2.40
@@ -1,6 +1,6 @@
 # Vend::Table::Common - Common access methods for Interchange databases
 #
-# $Id: Common.pm,v 2.39 2005/04/28 01:56:28 mheins Exp $
+# $Id: Common.pm,v 2.40 2005/04/30 15:09:59 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -23,13 +23,14 @@
 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA  02111-1307  USA.
 
-$VERSION = substr(q$Revision: 2.39 $, 10);
+$VERSION = substr(q$Revision: 2.40 $, 10);
 use strict;
 
 package Vend::Table::Common;
 require Vend::DbSearch;
 require Vend::TextSearch;
 require Vend::CounterFile;
+no warnings qw(uninitialized numeric);
 use Symbol;
 use Vend::Util;
 
@@ -479,6 +480,7 @@
 sub stuff_row {
     my ($s, @fields) = @_;
 	my $key = $fields[$s->[$KEY_INDEX]];
+
 #::logDebug("stuff key=$key");
 	$fields[$s->[$KEY_INDEX]] = $key = $s->autonumber()
 		if ! length($key);
@@ -934,7 +936,8 @@
 	}
 	else {
 #::logDebug(	" \$Vend::Interpolate::Tmp->{$opt->{arrayref}}");
-		$ref = $Vend::Interpolate::Tmp->{$opt->{arrayref}} = $search->array($spec);
+		$ref = $Vend::Interpolate::Tmp->{$opt->{arrayref} || ''}
+			 = $search->array($spec);
 		$opt->{object} = $search;
 		$opt->{prefix} = 'sql' unless defined $opt->{prefix};
 	}



2.62      +3 -2      interchange/lib/Vend/Table/DBI.pm


rev 2.62, prev_rev 2.61
Index: DBI.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/DBI.pm,v
retrieving revision 2.61
retrieving revision 2.62
diff -u -r2.61 -r2.62
--- DBI.pm	23 Jul 2004 03:03:39 -0000	2.61
+++ DBI.pm	30 Apr 2005 15:09:59 -0000	2.62
@@ -1,6 +1,6 @@
 # Vend::Table::DBI - Access a table stored in an DBI/DBD database
 #
-# $Id: DBI.pm,v 2.61 2004/07/23 03:03:39 mheins Exp $
+# $Id: DBI.pm,v 2.62 2005/04/30 15:09:59 mheins Exp $
 #
 # Copyright (C) 2002-2004 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -21,9 +21,10 @@
 # MA  02111-1307  USA.
 
 package Vend::Table::DBI;
-$VERSION = substr(q$Revision: 2.61 $, 10);
+$VERSION = substr(q$Revision: 2.62 $, 10);
 
 use strict;
+no warnings qw(uninitialized numeric);
 
 # 0: dummy open object
 # 1: table name



1.75      +3 -2      interchange/lib/Vend/Table/Editor.pm


rev 1.75, prev_rev 1.74
Index: Editor.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/Editor.pm,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- Editor.pm	25 Apr 2005 05:43:55 -0000	1.74
+++ Editor.pm	30 Apr 2005 15:09:59 -0000	1.75
@@ -1,6 +1,6 @@
 # Vend::Table::Editor - Swiss-army-knife table editor for Interchange
 #
-# $Id: Editor.pm,v 1.74 2005/04/25 05:43:55 mheins Exp $
+# $Id: Editor.pm,v 1.75 2005/04/30 15:09:59 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 2002 Mike Heins <mike at perusion.net>
@@ -26,7 +26,7 @@
 package Vend::Table::Editor;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.74 $, 10);
+$VERSION = substr(q$Revision: 1.75 $, 10);
 
 use Vend::Util;
 use Vend::Interpolate;
@@ -34,6 +34,7 @@
 use Exporter;
 @EXPORT_OK = qw/meta_record expand_values tabbed_display display/;
 use strict;
+no warnings qw(uninitialized numeric);
 
 =head1 NAME
 








More information about the interchange-cvs mailing list