Changeset 15890


Ignore:
Timestamp:
2008-06-06T11:04:57+12:00 (16 years ago)
Author:
mdewsnip
Message:

Adding "use strict", and fixing problems identified.

Location:
gsdl/trunk/perllib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/ClassifyTreeNode.pm

    r12844 r15890  
    44use ClassifyTreePath;
    55use GDBMUtils;
     6use strict;
    67
    78# /** Constructor
     
    121122        # and then replacing any occurance to the parents old clid with the
    122123        # parents new clid
    123         $old_child_clid = $child_node->getCLID();
     124        my $old_child_clid = $child_node->getCLID();
    124125        #rint STDERR "* considering: " . $old_child_clid . "\n";
    125126        if($old_child_clid =~ /^CL/)
    126127          {
    127             $new_child_clid = $new_clid . substr($old_child_clid, length($old_clid));
     128            my $new_child_clid = $new_clid . substr($old_child_clid, length($old_clid));
    128129            #rint STDERR "* shifting child $old_child_clid to $new_child_clid\n";
    129130            $child_node->changeCLID($new_child_clid);
     
    407408            # children first!
    408409            @children = reverse $self->getChildren();
    409             $offset2 = scalar(@children) + 1;
     410            my $offset2 = scalar(@children) + 1;
    410411            foreach my $sibling_node (@children)
    411412              {
     
    432433    $child_node->setTitle($path->getLastPathComponent());
    433434    # Update the contains metadata for this node
    434     $contains = $self->getContains();
     435    my $contains = $self->getContains();
    435436    if($contains =~ /\w/)
    436437      {
  • gsdl/trunk/perllib/GDBMUtils.pm

    r12844 r15890  
    11package GDBMUtils;
    22
     3use strict;
    34use util;
    45
    5 $debug = 0;
     6my $debug = 0;
    67
    78# /** Global variable to hold a string containing the last collection a gdbmGet
     
    4243      }
    4344    # Where's the database?
    44     $database = &getDatabasePath($collection);
     45    my $database = &getDatabasePath($collection);
    4546    # Are we in windows? Do we need .exe?
    46     $exe = "";
     47    my $exe = "";
    4748    $exe = ".exe" if $ENV{'GSDLOS'} =~ /^windows$/i;
    4849    # Retrieve the raw document content
    4950    print STDERR "#Get document\ncmd: gdbmget$exe \"$database\" \"$oid\"\n" if $debug;
    50     $value = `gdbmget$exe "$database" "$oid"`;
     51    my $value = `gdbmget$exe "$database" "$oid"`;
    5152    # Tidy up the ever growing number of newlines at the end of the value
    5253    $value =~ s/(\r?\n)+/$1/g;
     
    7374    my ($collection, $oid, $value) = @_;
    7475    # Where's the database?
    75     $database = &getDatabasePath($collection);
     76    my $database = &getDatabasePath($collection);
    7677    # Are we in windows? Do we need .exe?
    7778    my $exe = &util::get_os_exe();
     
    108109sub getDatabasePath()
    109110  {
    110     $collection = shift(@_);
     111    my $collection = shift(@_);
    111112    # Find out the database extension
    112113    my $ext = ".bdb";
  • gsdl/trunk/perllib/IncrementalBuildUtils.pm

    r15720 r15890  
    5252use cfgread;
    5353use colcfg;
     54use strict;
    5455use util;
    5556
     
    5859
    5960# Change debugging to 1 if you want verbose debugging output
    60 $debug = 1;
     61my $debug = 1;
    6162
    6263# Ensure the collection specific binaries are on the search path
     
    301302            print STDERR "CMD: " . $cmd . "\n" unless !$debug;
    302303            # Run command
    303             $result = `$cmd 2>&1`;
     304            my $result = `$cmd 2>&1`;
    304305            print STDERR $result unless !$debug;
    305306          }
     
    362363            print STDERR "CMD: java -classpath \"$classpath:$jarpath\" $java_lucene $cur_java_args 2>&1\n" unless !$debug;
    363364            # Run command
    364             $result = `java -classpath \"$classpath:$jarpath\" $java_lucene $cur_java_args 2>&1`;
     365            my $result = `java -classpath \"$classpath:$jarpath\" $java_lucene $cur_java_args 2>&1`;
    365366            print STDERR $result unless !$debug;
    366367          }
     
    423424        print STDERR "* searching for classifier paths to be removed\n";
    424425       
    425         my $metadata = $doc_obj->getAllMetadata($section);
     426        my $metadata = $doc_obj->getAllMetadata();
    426427        foreach my $pair (@$metadata)
    427428          {
     
    430431            if (defined($classifier_tree_models{$key}))
    431432              {
    432                 $model = $classifier_tree_models{$key};
     433                my $model = $classifier_tree_models{$key};
    433434                print STDERR "* removing '" . $value . "' from classifier " . $model->getRootNode()->getCLID() . "\n";
    434435                $model->removeDocument($value, $oid, 1);
Note: See TracChangeset for help on using the changeset viewer.