Index: /trunk/gsdl/perllib/plugins/ArcPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/ArcPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/ArcPlug.pm	(revision 10254)
@@ -38,7 +38,13 @@
 use gsprintf;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 BEGIN {
     @ArcPlug::ISA = ('BasPlug');
 }
+
+my $arguments = [
+		 ];
 
 my $options = { 'name'     => "ArcPlug",
@@ -46,5 +52,5 @@
 		'abstract' => "no",
 		'inherits' => "yes" };
-
+         
 sub gsprintf
 {
@@ -57,5 +63,5 @@
     push(@$pluginlist, $class);
 
-    if(defined $arguments){print "SETSEGE\n"; push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
+    if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
 
@@ -79,5 +85,6 @@
 	foreach my $subfile (@$file_list) {
 	    my $doc_oid = $subfile->[1];
-	    $index_status = $archive_info->get_status_info($doc_oid);
+	    # why do we get this when it is not used???
+	    my $index_status = $archive_info->get_status_info($doc_oid);
 	    $archive_info->set_status_info($doc_oid,"B");
 	}
@@ -133,5 +140,5 @@
 	    my $doc_oid = $subfile->[1];
 
-	    $index_status = $archive_info->get_status_info($doc_oid);
+	    my $index_status = $archive_info->get_status_info($doc_oid);
 
 	    my $processor_mode = $processor->get_mode();	    
Index: /trunk/gsdl/perllib/plugins/BNContentePlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/BNContentePlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/BNContentePlug.pm	(revision 10254)
@@ -37,4 +37,7 @@
 use XMLParser;
 use XML::Parser;
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
Index: /trunk/gsdl/perllib/plugins/BasPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/BasPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/BasPlug.pm	(revision 10254)
@@ -36,5 +36,7 @@
 $SIG{__WARN__} = sub {warn($_[0]) unless ($_[0] =~ /Subroutine\s+\S+\sredefined/)};
 
-use strict; no strict 'subs';
+use strict; 
+no strict 'subs';
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 use File::Basename;
Index: /trunk/gsdl/perllib/plugins/BibTexPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/BibTexPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/BibTexPlug.pm	(revision 10254)
@@ -45,8 +45,10 @@
 
 use SplitPlug;
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 # BibTexPlug is a sub-class of BasPlug.
 sub BEGIN {
-    @ISA = ('SplitPlug');
+    @BibTexPlug::ISA = ('SplitPlug');
 }
 
@@ -103,4 +105,5 @@
     my $outhandle = $self->{'outhandle'};
 
+    my $cursection = $doc_obj->get_top_section();
     $self->{'key'} = "default";
 
Index: /trunk/gsdl/perllib/plugins/BookPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/BookPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/BookPlug.pm	(revision 10254)
@@ -55,7 +55,9 @@
 use BasPlug;
 use util;
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
-    @ISA = ('BasPlug');
+    @BookPlug::ISA = ('BasPlug');
 }
 
@@ -197,4 +199,5 @@
 
 sub replace_image_links {
+    my $self = shift (@_);
     my ($dir, $doc_obj, $front, $link, $back) = @_;
     my $outhandle = $self->{'outhandle'};
Index: /trunk/gsdl/perllib/plugins/ConvertToPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/ConvertToPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/ConvertToPlug.pm	(revision 10254)
@@ -43,6 +43,9 @@
 use ghtml;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 sub BEGIN {
-    @ISA = ('HTMLPlug');
+    @ConvertToPlug::ISA = ('HTMLPlug');
 #    @ISA = ('HTMLPlug', 'TEXTPlug');
 #    @ISA = ('BasPlug'); #, 'HTMLPlug', 'TEXTPlug');
Index: /trunk/gsdl/perllib/plugins/ConvertToRogPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/ConvertToRogPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/ConvertToRogPlug.pm	(revision 10254)
@@ -30,35 +30,17 @@
 use BasPlug;
 use RogPlug;
-
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
-    @ISA = ('RogPlug');
-}
-
+    @ConvertToRogPlug::ISA = ('RogPlug');
+}
+
+my $arguments = [
+		 ];
 my $options = { 'name'     => "ConvertToRogPlug",
 		'desc'     => "{ConvertToRogPlug.desc}",
 		'abstract' => "yes",
 		'inherits' => "yes" };
-
-
-sub parse_args
-{
-    my $class = shift (@_);
-    my ($args) = @_;
-
-    my $plugin_name = $class;
-    $plugin_name =~ s/\.pm$//;
-
-    if (!parsargv::parse($args,  
-			 "allow_extra_options")) {
-
-	print STDERR "\nIncorrect options passed to $plugin_name, ";
-	print STDERR "check your collect.cfg configuration file\n";
-	$self->print_txt_usage("");  # Use default resource bundle
-	die "\n";
-    }
-   
-    return ($plugin_name);
-}
 
 sub new {
@@ -312,5 +294,5 @@
     $doc_obj->add_metadata($cursection, "TVal",          $song->{'tval'}); 
 
-    foreach $md ( @{$song->{'metadata'}} )
+    foreach my $md ( @{$song->{'metadata'}} )
     {
 	$doc_obj->add_metadata($cursection, $md->[0], $md->[1]); 
Index: /trunk/gsdl/perllib/plugins/DSpacePlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/DSpacePlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/DSpacePlug.pm	(revision 10254)
@@ -52,4 +52,6 @@
 #use ghtml;
 use XMLParser;
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
Index: /trunk/gsdl/perllib/plugins/EMAILPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/EMAILPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/EMAILPlug.pm	(revision 10254)
@@ -63,14 +63,11 @@
 
 # 12/05/02 Added usage datastructure - John Thompson
+package EMAILPlug;
 
 use strict;
 no strict "refs"; # so we can use a variable as a filehandle for print $out
 
-package EMAILPlug;
 
 use SplitPlug;
-# EMAILPlug is a sub-class of SplitPlug.
-@EMAILPlug::ISA = ('SplitPlug');
-
 use unicode;  # gs conv functions
 use gsprintf 'gsprintf'; # translations
@@ -79,4 +76,7 @@
 use util;
 
+sub BEGIN {
+    @EMAILPlug::ISA = ('SplitPlug');
+}
 
 
Index: /trunk/gsdl/perllib/plugins/ExcelPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/ExcelPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/ExcelPlug.pm	(revision 10254)
@@ -29,7 +29,9 @@
 
 use ConvertToPlug;
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
-    @ISA = ('ConvertToPlug');
+    @ExcelPlug::ISA = ('ConvertToPlug');
 }
 
Index: /trunk/gsdl/perllib/plugins/FOXPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/FOXPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/FOXPlug.pm	(revision 10254)
@@ -40,8 +40,14 @@
 # use gb;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 
 sub BEGIN {
-    @ISA = ('BasPlug');
-}
+    @FOXPlug::ISA = ('BasPlug');
+}
+
+my $arguments = [
+		 ];
 
 my $options = { 'name'     => "FOXPlug",
@@ -149,5 +155,5 @@
 
     # open the dbt file if we need to
-    $dbtfullname = $fullname;
+    my $dbtfullname = $fullname;
     if ($fullname =~ /f$/) {
 	$dbtfullname =~ s/f$/t/;
@@ -172,5 +178,5 @@
 	my $record = [];
 	
-	foreach $field (@{$dbf{'fieldinfo'}}) {
+	foreach my $field (@{$dbf{'fieldinfo'}}) {
 	    my $fieldvalue = "";
 	    
@@ -267,5 +273,5 @@
 
     # add each field
-    foreach $field (@$record) {
+    foreach my $field (@$record) {
 	if (defined ($field->{'name'}) && defined ($field->{'value'})) {
 	    $doc_obj->add_utf8_text($section, "  <tr>\n");
Index: /trunk/gsdl/perllib/plugins/FavouritesPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/FavouritesPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/FavouritesPlug.pm	(revision 10254)
@@ -32,4 +32,6 @@
 use BasPlug;
 use parsargv;
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
@@ -78,4 +80,5 @@
     my $outhandle = $self->{'outhandle'};
 
+    my $section = $doc_obj->get_top_section();
     print STDERR "<Processing n='$file' p='FavouritesPlug'>\n" if ($gli);
     print $outhandle "FavouritesPlug: processing $file\n" if $self->{'verbosity'} > 1;
@@ -87,9 +90,9 @@
     my $title = $file;
     $title =~ s/.url$//i;
-    $doc_obj->add_utf8_metadata($cursection, "Title", $title);
+    $doc_obj->add_utf8_metadata($section, "Title", $title);
 
     # get the URL from the file
     my ($url) = ($$textref =~ m/^URL=(http.+)/mg);
-    $doc_obj->add_metadata($cursection, "URL", $url);
+    $doc_obj->add_metadata($section, "URL", $url);
 
     # Add srclink metadata for an automatic link to the webpage
@@ -103,7 +106,7 @@
     $$textref =~ s/\]/<\/strong><p>/g;
     $$textref =~ s/^Modified=(.+)$/<strong>Modified<\/strong>$1<p>/g;
-    $doc_obj->add_utf8_text($cursection, "$$textref");
+    $doc_obj->add_utf8_text($section, "$$textref");
 
-    $doc_obj->add_metadata($cursection, "FileFormat", "Favourite");
+    $doc_obj->add_metadata($section, "FileFormat", "Favourite");
     return 1;
 }
Index: /trunk/gsdl/perllib/plugins/GAPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/GAPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/GAPlug.pm	(revision 10254)
@@ -32,6 +32,7 @@
 
 use XMLPlug;
-#$%^
-use parse2;
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
@@ -45,4 +46,7 @@
     return q^(?i)doc\.xml$^;
 }
+
+my $arguments = [
+		 ];
 
 my $options = { 'name'     => "GAPlug",
Index: /trunk/gsdl/perllib/plugins/GISBasPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/GISBasPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/GISBasPlug.pm	(revision 10254)
@@ -28,4 +28,7 @@
 use util;
 use locale;
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 #field categories in DataBase files
@@ -35,5 +38,5 @@
 my $DSG = 10;
 #$CC1 = 12;
-$FULL_NAME = 22;
+my $FULL_NAME = 22;
 
 BEGIN {
@@ -76,4 +79,8 @@
 }
 
+sub print_txt_usage
+{
+   BasPlug::print_txt_usage(@_);
+}
 
 sub has_mapdata
@@ -153,5 +160,5 @@
 sub placename_to_anchorname {
 	my ($placename) = @_;
-	$p_tag = lc($placename);
+	my $p_tag = lc($placename);
 	$p_tag =~ s/\s+//g;
 	return $p_tag;
@@ -202,6 +209,6 @@
     #finds 'dangerous' placenames (eg York and New York). Dangerous because program will find "York" within "New York"  
     my %danger = ();    
-    foreach $x (keys %$uniquePlaces){
-	foreach $y (keys %$uniquePlaces){
+    foreach my $x (keys %$uniquePlaces){
+	foreach my $y (keys %$uniquePlaces){
 		if(($y =~ m/ /) && ($y =~ m/$x/) && ($y ne $x)){
 			$y =~ s/($x\s)|(\s$x)//;
@@ -220,5 +227,5 @@
     foreach my $name (sort (keys %$uniquePlaces)){
 	if(!defined($danger{$name})){
-		$name_tag = placename_to_anchorname($name);
+		my $name_tag = placename_to_anchorname($name);
 		print FOUT "$name\t" . $uniquePlaces->{$name}->[$LONG] . "\t" . $uniquePlaces->{$name}->[$LAT] . "\n";
 		if($self->{'place_list'}) {$names = $names . "<a href=\"#" . $name_tag . "1\">" . $name . "</a>" . "\n";}
Index: /trunk/gsdl/perllib/plugins/GMLPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/GMLPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/GMLPlug.pm	(revision 10254)
@@ -35,6 +35,9 @@
 use doc;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 sub BEGIN {
-    @ISA = ('BasPlug');
+    @GMLPlug::ISA = ('BasPlug');
 }
 
Index: /trunk/gsdl/perllib/plugins/HBPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/HBPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/HBPlug.pm	(revision 10254)
@@ -37,6 +37,4 @@
 # expects the marked up files to be cleaner than those used by the
 # Humanity Library collections
-
-# 12/05/02 Added usage datastructure - John Thompson
 
 package HBPlug;
@@ -48,7 +46,9 @@
 use doc;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
-    @ISA = ('BasPlug');
+    @HBPlug::ISA = ('BasPlug');
 }
 
Index: /trunk/gsdl/perllib/plugins/ISISPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/ISISPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/ISISPlug.pm	(revision 10254)
@@ -31,8 +31,10 @@
 use SplitPlug;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 # ISISPlug is a sub-class of SplitPlug.
 sub BEGIN {
-    @ISA = ('SplitPlug');
+    @ISISPlug::ISA = ('SplitPlug');
 }
 
@@ -155,4 +157,5 @@
     my $outhandle = $self->{'outhandle'};
 
+    my $cursection = $doc_obj->get_top_section();
     my $subfield_separator = $self->{'subfield_separator'};
     my $entry_separator = $self->{'entry_separator'};
@@ -164,5 +167,5 @@
 
     # Process each line of the ISIS record, one at a time
-    foreach $line (split(/\n/, $$textref)) {
+    foreach my $line (split(/\n/, $$textref)) {
 	$line =~ /^tag=(.*) data=(.+)$/;
 	my $rawtagname = $1;
@@ -173,5 +176,5 @@
 	# Metadata field names: title case, then remove spaces
 	my $tagname = "";
-	foreach $word (split(/\s+/, $rawtagname)) {
+	foreach my $word (split(/\s+/, $rawtagname)) {
 	    substr($word, 0, 1) =~ tr/a-z/A-Z/;
 	    $tagname .= $word;
@@ -183,5 +186,5 @@
 	# Handle each piece of metadata ('%' separated)
 	my $completetagvalue = "";
-	foreach $rawtagvalue (split(/%/, $rawtagdata)) {
+	foreach my $rawtagvalue (split(/%/, $rawtagdata)) {
 	    $completetagvalue .= $entry_separator unless ($completetagvalue eq "");
 
@@ -255,5 +258,5 @@
 
     my $amongstdefinitions = 0;
-    foreach $fdtfileline (<FDT_FILE>) {
+    foreach my $fdtfileline (<FDT_FILE>) {
 	$fdtfileline =~ s/(\s*)$//;  # Remove any nasty spaces at the end of the lines
 
Index: /trunk/gsdl/perllib/plugins/ImagePlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/ImagePlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/ImagePlug.pm	(revision 10254)
@@ -28,6 +28,9 @@
 use BasPlug;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 sub BEGIN {
-    @ISA = ('BasPlug');
+    @ImagePlug::ISA = ('BasPlug');
 }
 
Index: /trunk/gsdl/perllib/plugins/IndexPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/IndexPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/IndexPlug.pm	(revision 10254)
@@ -60,7 +60,13 @@
 use cfgread;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 sub BEGIN {
-    @ISA = ('BasPlug');
+    @IndexPlug::ISA = ('BasPlug');
 }
+
+my $arguments = [
+		 ];
 
 my $options = { 'name'     => "IndexPlug",
Index: /trunk/gsdl/perllib/plugins/LaTeXPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/LaTeXPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/LaTeXPlug.pm	(revision 10254)
@@ -29,6 +29,6 @@
 
 # System complains about $arguments if the strict is set
-#use strict;
-#no strict 'refs'; # so we can print to a handle named by a variable
+use strict;
+no strict 'refs'; # so we can print to a handle named by a variable
 
 # greenstone packages
@@ -38,4 +38,6 @@
 use util;
 
+my $arguments = [
+		 ];
 my $options={ 'name' => 'LaTeXPlug',
 	      'desc' => '{LaTeXPlug.desc}',
Index: /trunk/gsdl/perllib/plugins/MACROPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/MACROPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/MACROPlug.pm	(revision 10254)
@@ -29,7 +29,9 @@
 use parsargv;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
-    @ISA = ('BasPlug');
+    @MACROPlug::ISA = ('BasPlug');
 }
 
@@ -175,12 +177,13 @@
     my $image_macro = "false";
     my $norm_macro = "false";
-
+    my $currpackage = "";
+    
     #print STDERR "FILE@@@@@ $file\n";
 
     #foreach my $ta (@textarray) {
 	
-    for ($k = 0; $k < scalar(@textarray); $k++) {
-	
-	$ta = $textarray[$k];
+    for (my $k = 0; $k < scalar(@textarray); $k++) {
+	
+	my $ta = $textarray[$k];
 
         #print STDERR "$ta\n" if ($file =~ m/port/);
@@ -370,5 +373,5 @@
     $results = $self->{'textcat'}->classify(\$text);
 
-    foreach $r (@$results) {
+    foreach my $r (@$results) {
 	print $outhandle "Results: $r\n";
 	
@@ -385,8 +388,8 @@
 	while (<LANGFILE>) {
 	    
-	    $line = $_;
+	    my $line = $_;
 	    chomp($line);
 
-	    $fn = $filename;
+	    my $fn = $filename;
 	    $fn =~ s/.*\/(.*)\..*/$1/;
 
@@ -398,8 +401,8 @@
 		print $outhandle "language code is $line\n";
 
-		foreach $r (@$results) {
+		foreach my $r (@$results) {
 		    print $outhandle "MY1 $r\n";
 
-		    $roar = $& if($r =~ m/../);
+		    my $roar = $& if($r =~ m/../);
 
 		    if ($roar eq $line) {
@@ -486,5 +489,5 @@
 
 	while ($try_len>=4) {
-	    $try_fn = substr($fn,0,$try_len);
+	    my $try_fn = substr($fn,0,$try_len);
 
 	    if (defined $lang_table->{$try_fn}) {
@@ -509,5 +512,5 @@
     $fn =~ s/\d+$//; # remove any digits from end of filename
 
-    my $languge;
+    my $language;
     my $encoding = "utf8";
 
Index: /trunk/gsdl/perllib/plugins/MARCPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/MARCPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/MARCPlug.pm	(revision 10254)
@@ -33,6 +33,9 @@
 use parsargv;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 sub BEGIN {
-    @ISA = ('SplitPlug');
+    @MARCPlug::ISA = ('SplitPlug');
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
 }
@@ -261,5 +264,5 @@
     my @words = split(/ /, $text);
 
-    foreach $word (@words) {
+    foreach my $word (@words) {
 	# If printing this word would exceed the column end, start a new line
 	if (($linelength + length($word)) >= $columnwidth) {
@@ -301,6 +304,6 @@
 	    foreach $metavalue ( @metavalues )
 	    {
-		$metavalue_str = $self->to_utf8($encoding,$metavalue->as_string());
-		$doc_obj->add_utf8_metadata ($thissection, $metaname, $metavalue_str);
+		my $metavalue_str = $self->to_utf8($encoding,$metavalue->as_string());
+		$doc_obj->add_utf8_metadata ($section, $metaname, $metavalue_str);
 	    }
 	}
Index: /trunk/gsdl/perllib/plugins/METSPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/METSPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/METSPlug.pm	(revision 10254)
@@ -35,4 +35,7 @@
 use ghtml;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 use XMLPlug;
 use XML::XPath;
@@ -43,4 +46,6 @@
 }
 
+my $arguments = [
+		 ];
 my $options = { 'name'     => "METSPlug",
 		'desc'     => "{METSPlug.desc}",
Index: /trunk/gsdl/perllib/plugins/MP3Plug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/MP3Plug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/MP3Plug.pm	(revision 10254)
@@ -31,4 +31,7 @@
 use parsargv;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 use MP3::Info;
 
@@ -36,5 +39,5 @@
 
 sub BEGIN {
-    @ISA = ('UnknownPlug');
+    @MP3Plug::ISA = ('UnknownPlug');
 }
 
@@ -179,5 +182,5 @@
 	    if ($mp3_metavalue !~ m/^\s*$/s) {
 		my $kt_len = length($kt);
-		$kt_initial_cap = uc(substr($kt,0,1)).lc(substr($kt,1,$kt_len-1));
+		my $kt_initial_cap = uc(substr($kt,0,1)).lc(substr($kt,1,$kt_len-1));
 		my $mp3_metaname = "mp3:".$kt_initial_cap;
 		
Index: /trunk/gsdl/perllib/plugins/MetadataPass.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/MetadataPass.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/MetadataPass.pm	(revision 10254)
@@ -26,4 +26,6 @@
 package MetadataPass;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 use BasPlug; # uses BasPlug, but is not inherited
Index: /trunk/gsdl/perllib/plugins/NULPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/NULPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/NULPlug.pm	(revision 10254)
@@ -38,6 +38,7 @@
 
 use BasPlug;
-use parsargv;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
@@ -45,7 +46,6 @@
 }
 
-#my $arguments =
-#    [ 
-#      ];
+my $arguments = [
+		 ];
 
 my $options = { 'name'     => "NULPlug",
Index: /trunk/gsdl/perllib/plugins/OAIPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/OAIPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/OAIPlug.pm	(revision 10254)
@@ -30,5 +30,7 @@
 use unicode;
 use util;
-use parsargv;
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 use XMLPlug;
@@ -53,4 +55,5 @@
 		'args'     => $arguments };
 
+
 sub new {
     my ($class) = shift (@_);
@@ -73,4 +76,5 @@
 
 sub xml_start_document {
+    my $self = shift (@_);
     $self->{'in_metadata_node'} = 0;
     $self->{'rawxml'} = "";
@@ -170,5 +174,5 @@
 	
 	my $url_array = $metadata->{'URL'};
-	my $num_urls = (defined $url_arry) ? scalar(@$url_array) : 0;
+	my $num_urls = (defined $url_array) ? scalar(@$url_array) : 0;
 	
 	my $srcdoc_exists = 0;
@@ -331,5 +335,5 @@
     if ($$textref =~ m/<metadata\s*>(.*?)<\/metadata\s*>/s)
     {
-	$metadata_text = $1;
+	my $metadata_text = $1;
 	$metadata_text =~ s/^.*?<(oai_dc:)?dc.*?>(.*?)<\/(oai_dc:)?dc>.*?/$2/s;
 
Index: /trunk/gsdl/perllib/plugins/OggVorbisPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/OggVorbisPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/OggVorbisPlug.pm	(revision 10254)
@@ -33,4 +33,6 @@
 use Ogg::Vorbis::Header::PurePerl;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
@@ -103,5 +105,6 @@
     my $doc_obj = new doc ($filename, "indexed_doc");
     $doc_obj->set_OIDtype ("incremental");    # this is done to avoid hashing content of file
-
+    my $section = $doc_obj->get_top_section();
+    
     # replace spaces in filename with %20 in url for metadata entry
     my $url = $file;
@@ -153,5 +156,4 @@
 
     # include any metadata passed in from previous plugins
-    my $section = $doc_obj->get_top_section();
     $self->extra_metadata ($doc_obj, $section, $metadata);
 
Index: /trunk/gsdl/perllib/plugins/PPTPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/PPTPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/PPTPlug.pm	(revision 10254)
@@ -29,7 +29,9 @@
 
 use ConvertToPlug;
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
-    @ISA = ('ConvertToPlug');
+    @PPTPlug::ISA = ('ConvertToPlug');
 }
 
Index: /trunk/gsdl/perllib/plugins/PSPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/PSPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/PSPlug.pm	(revision 10254)
@@ -31,6 +31,9 @@
 use sorttools;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 sub BEGIN {
-    @ISA = ('ConvertToPlug');
+    @PSPlug::ISA = ('ConvertToPlug');
 }
 
Index: /trunk/gsdl/perllib/plugins/PagedImgPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/PagedImgPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/PagedImgPlug.pm	(revision 10254)
@@ -135,4 +135,6 @@
 
 use XMLPlug;
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
@@ -282,5 +284,5 @@
 	my $filehead = &util::get_tmp_filename();
 	$filename = $filehead . ".$converttotype";
-	$n = 1;
+	my $n = 1;
 	while (-e $filename) {
 	    $filename = "$filehead$n\.$converttotype";
@@ -527,5 +529,5 @@
 
 sub read {
-    $self = shift (@_);
+    my $self = shift (@_);
     my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
     my $outhandle   = $self->{'outhandle'};
@@ -643,9 +645,10 @@
     $self->extra_metadata ($doc_obj, $section, $metadata);
 
-    # do plugin specific processing of doc_obj
-    unless (defined ($self->process(\$text, $pluginfo, $base_dir, $file, $metadata, $doc_obj))) {
-	print STDERR "<ProcessingError n='$file'>\n" if ($gli);
-	return -1;
-    }
+    # do plugin specific processing of doc_obj - don't need this unless
+    # something inherits from PagedImgPlug
+    #unless (defined ($self->process(\$text, $pluginfo, $base_dir, $file, $metadata, $doc_obj))) {
+#	print STDERR "<ProcessingError n='$file'>\n" if ($gli);
+#	return -1;
+#    }
 
     # do any automatic metadata extraction
@@ -806,5 +809,5 @@
 	if ($line =~ /^<([^>]*)>(.*?)\s*$/) {
 	    $doc_obj->set_utf8_metadata_element ($topsection, $1, $2);
-	    $meta->{$1} = $2;
+	    #$meta->{$1} = $2;
 	} else {
 	    $num++;
Index: /trunk/gsdl/perllib/plugins/ProCitePlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/ProCitePlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/ProCitePlug.pm	(revision 10254)
@@ -31,8 +31,10 @@
 use SplitPlug;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 # ProCitePlug is a sub-class of SplitPlug
 sub BEGIN {
-    @ISA = ('SplitPlug');
+    @ProCitePlug::ISA = ('SplitPlug');
 }
 
@@ -158,5 +160,5 @@
     my $outhandle = $self->{'outhandle'};
     my $filename = &util::filename_cat($base_dir, $file);
-
+    my $cursection = $doc_obj->get_top_section();
     # Report that we're processing the file
     print STDERR "<Processing n='$file' p='ProCitePlug'>\n" if ($gli);
@@ -216,5 +218,5 @@
 
 	    # Multiple metadata values are separated with "//"
-	    foreach $field_value (split(/\/\//, $field_value_raw)) {
+	    foreach my $field_value (split(/\/\//, $field_value_raw)) {
 		my $meta_name = "pc.Field" . ($fieldnum + 1) . "Value";
 		$doc_obj->add_utf8_metadata($cursection, $meta_name, $field_value);
Index: /trunk/gsdl/perllib/plugins/RTFPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/RTFPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/RTFPlug.pm	(revision 10254)
@@ -30,7 +30,9 @@
 
 use ConvertToPlug;
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
-    @ISA = ('ConvertToPlug');
+    @RTFPlug::ISA = ('ConvertToPlug');
 }
 
Index: /trunk/gsdl/perllib/plugins/RecPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/RecPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/RecPlug.pm	(revision 10254)
@@ -99,5 +99,6 @@
 
 use File::Basename;
-
+use strict;
+no strict 'refs';
 
 BEGIN {
Index: /trunk/gsdl/perllib/plugins/ReferPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/ReferPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/ReferPlug.pm	(revision 10254)
@@ -66,8 +66,10 @@
 
 use SplitPlug;
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 # ReferPlug is a sub-class of BasPlug.
 sub BEGIN {
-    @ISA = ('SplitPlug');
+    @ReferPlug::ISA = ('SplitPlug');
 }
 
@@ -125,4 +127,5 @@
     return undef unless ($$textref =~ /^\s*%/);
 
+    my $cursection = $doc_obj->get_top_section();
     # Report that we're processing the file
     print STDERR "<Processing n='$file' p='ReferPlug'>\n" if ($gli);
@@ -165,5 +168,5 @@
 	$line =~ s/\s+/ /g;
 	$text .= "$line\n";
-	$ReferFormat .= "$line\n";
+	# $ReferFormat .= "$line\n"; # what is this???
 	
 	next unless ($line =~ /^%[A-Z\*]/);
Index: /trunk/gsdl/perllib/plugins/RogPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/RogPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/RogPlug.pm	(revision 10254)
@@ -32,6 +32,9 @@
 use doc; 
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 sub BEGIN {
-    @ISA = ('BasPlug');
+    @RogPlug::ISA = ('BasPlug');
 }
 
@@ -196,5 +199,5 @@
     $doc_obj->add_metadata($cursection, "FileSize",      (-s $file));
 
-    foreach $md ( @{$song->{'metadata'}} )
+    foreach my $md ( @{$song->{'metadata'}} )
     {
 	$doc_obj->add_metadata($cursection, $md->[0], $md->[1]); 
Index: /trunk/gsdl/perllib/plugins/SRCPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/SRCPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/SRCPlug.pm	(revision 10254)
@@ -42,6 +42,9 @@
 use parsargv;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 sub BEGIN {
-    @ISA = ('BasPlug');
+    @SRCPlug::ISA = ('BasPlug');
 }
 
@@ -174,5 +177,5 @@
 	($$textref =~ m/^\s*\#\s*include\s*(?:\"|&lt;)(.*?)(?:\"|&gt;)/mg);
     
-    my $incs_done_ref=$doc_obj->get_metadata($section, "includes");
+    my $incs_done_ref=$doc_obj->get_metadata($topsection, "includes");
     my @incs_done;
     if (defined($incs_done_ref)) {
@@ -230,5 +233,5 @@
 		my $classname=$1;
 		$classname =~ s/.*class\W(\w+).*/$1/;
-		my $classes=$doc_obj->get_metadata($section, "class");
+		my $classes=$doc_obj->get_metadata($topsection, "class");
 		foreach my $elem (@$classes) {
 		    if ("$elem" eq "$classname") {goto class_done;}
Index: /trunk/gsdl/perllib/plugins/SplitPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/SplitPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/SplitPlug.pm	(revision 10254)
@@ -44,7 +44,10 @@
 use util;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
 # SplitPlug is a sub-class of BasPlug.
 sub BEGIN {
-@SplitPlug::ISA = ('BasPlug');
+    @SplitPlug::ISA = ('BasPlug');
 }
 
@@ -120,5 +123,5 @@
 					      $extrametadata, $processor, 
 					      $maxdocs, $gli);
-    $split_matched = undef;
+    my $split_matched = undef;
 
     if ($matched) {
Index: /trunk/gsdl/perllib/plugins/TEXTPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/TEXTPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/TEXTPlug.pm	(revision 10254)
@@ -32,9 +32,10 @@
 
 use BasPlug;
-use parsargv;
 
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
-    @ISA = ('BasPlug');
+    @TEXTPlug::ISA = ('BasPlug');
 }
 
Index: /trunk/gsdl/perllib/plugins/UnknownPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/UnknownPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/UnknownPlug.pm	(revision 10254)
@@ -57,9 +57,7 @@
 
 use BasPlug;
-use parsargv;
-#$%^
-use parse2;
-
-
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
Index: /trunk/gsdl/perllib/plugins/W3ImgPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/W3ImgPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/W3ImgPlug.pm	(revision 10254)
@@ -117,8 +117,9 @@
 use util;
 use parsargv;
-use strict 'subs';
+use strict; # 'subs';
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
-    @ISA = qw( HTMLPlug );
+    @W3ImgPlug::ISA = qw( HTMLPlug );
 }
 
@@ -423,6 +424,6 @@
 	    $doc_obj = new doc ("", "indexed_doc");
 	    $section = $doc_obj->get_top_section();
-	    $prevpos = ( $i == 0 ? 0 : $imgs->{$fplist[$i - 1]}{'pos'});
-	    $nextpos = ( $i >= ($nimgs -1) ? -1 : $imgs->{$fplist[$i + 1]}{'pos'} );
+	    my $prevpos = ( $i == 0 ? 0 : $imgs->{$fplist[$i - 1]}{'pos'});
+	    my $nextpos = ( $i >= ($nimgs -1) ? -1 : $imgs->{$fplist[$i + 1]}{'pos'} );
 
 	    $self->extract_image_info($imgtag, $filepath, $textref, $doc_obj, $section, $tndir, $prevpos, $nextpos);
@@ -459,5 +460,5 @@
     $orig_fp =~ s/\\/\//g;
     $filepath = "$self->{'htpath'}/$filepath";
-    ($onlyfn) = $filename =~ /([^\\\/]*)$/;
+    my ($onlyfn) = $filename =~ /([^\\\/]*)$/;
     ($fn, $ext) = $onlyfn =~ /(.*)\.(.*)/;
     $fn = lc $fn; $ext = lc $ext;
@@ -601,5 +602,5 @@
     if ( $self->{'aggressiveness'} == 5 && ! $self->{'smallpage'} ) {
 	@pagemeta = $self->get_page_metadata($textref);
-	foreach $value ( @pagemeta ) {
+	foreach my $value ( @pagemeta ) {
 	    $context .= "$value."; # make each into psuedo-sentence
 	}
@@ -611,7 +612,7 @@
 
     # extract general references
-    foreach $rw ( @refwords ) {
+    foreach my $rw ( @refwords ) {
 	while ( $context =~ /[\.\?\!\,](.*?$rw\W.*?[\.\?\!\,])/ig ) {
-	    $sentence = $1;
+	    my $sentence = $1;
 	    $sentence =~ s/\s+/ /g;
 	    $sentences{$sentence}+=2;
@@ -621,7 +622,7 @@
     my ($fignum) = $context =~ /[\.\?\!].*?(?:figure|table)s?[\-\_\ \.](\d+\w*)\W.*?[\.\?\!]/ig;
     if ( $fignum ) {
-	foreach $rw ( @refwords ) {
+	foreach my $rw ( @refwords ) {
 	    while ( $context =~ /[\.\?\!](.*?(figure|table)[\-\_\ \.]$fignum\W.*?[\.\?\!])/ig ) {
-		$sentence = $1;
+		my $sentence = $1;
 		$sentence =~ s/\s+/ /g;
 		$sentences{$sentence}+=4;
@@ -632,13 +633,13 @@
     # sentences with occurances of important words
     @relwords = $reltext =~ /([a-zA-Z]{4,})/g; # take out small words
-    foreach $word ( @relwords ) {
+    foreach my $word ( @relwords ) {
 	if ( $self->{'stopwords'}{$word} ) { next } # skip stop words
 	while ( $context =~ /([^\.\?\!]*?$word\W.*?[\.\?\!])/ig ) {
-	    $sentence = $1;
+	    my $sentence = $1;
 	    $sentence =~ s/\s+/ /g;
 	    $sentences{$sentence}++;
 	}
     }
-    foreach $sentence ( keys %sentences ) {
+    foreach my $sentence ( keys %sentences ) {
 	if ($sentences{$sentence} < $self->{'textrefs_threshold'}) {
 	    delete $sentences{$sentence};
@@ -656,5 +657,5 @@
 sub extract_caption_text {
     my ($self, $tag, $textref, $prevpos, $pos, $nextpos) = (@_);
-    my (@neartext, $len, $hdelim, $goodlen,
+    my (@neartext, $len, $hdelim, $mintext, $goodlen,
 	$startpos, $context, $context_size);
     
@@ -1003,5 +1004,5 @@
     }
     $num = 0;
-    foreach $i ( keys %{$imgs} ) {
+    foreach my $i ( keys %{$imgs} ) {
 	if ( $imgs->{$i}{'pos'} ) {
 	    $num++;
Index: /trunk/gsdl/perllib/plugins/WordPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/WordPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/WordPlug.pm	(revision 10254)
@@ -29,7 +29,9 @@
 
 use ConvertToPlug;
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
-    @ISA = ('ConvertToPlug');
+    @WordPlug::ISA = ('ConvertToPlug');
 }
 
Index: /trunk/gsdl/perllib/plugins/XMLPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/XMLPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/XMLPlug.pm	(revision 10254)
@@ -28,6 +28,6 @@
 use BasPlug;
 use doc;
-#$%^
-use parse2;
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 sub BEGIN {
@@ -106,5 +106,5 @@
 	if (open(XMLIN,"<$filename")) {
 
-	    $untransformed_xml = "";
+	    my $untransformed_xml = "";
 	    while (defined (my $line = <XMLIN>)) {
 
@@ -138,5 +138,5 @@
     }
     else {
-	print $outhandle "Error: Unable to run command $xsl_cmd\n";
+	print $outhandle "Error: Unable to run command $xslt_cmd\n";
 	print $outhandle "       $!\n";
     }
Index: /trunk/gsdl/perllib/plugins/ZIPPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/ZIPPlug.pm	(revision 10253)
+++ /trunk/gsdl/perllib/plugins/ZIPPlug.pm	(revision 10254)
@@ -50,10 +50,10 @@
 use util;
 use Cwd;
-#$%^
-use parse2;
-
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
 
 BEGIN {
-    @ISA = ('BasPlug');
+    @ZIPPlug::ISA = ('BasPlug');
 }
 
