Changeset 15716

Show
Ignore:
Timestamp:
27.05.2008 13:03:59 (11 years ago)
Author:
mdewsnip
Message:

Added "use strict" and fixed various problems that it found.

Files:
1 modified

Legend:

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

    r15003 r15716  
    2727 
    2828use basebuilder; 
    29 use classify; 
    30 use cfgread; 
    31 use colcfg; 
    3229use plugin; 
     30use strict; no strict 'refs'; 
    3331use util; 
    34 use FileHandle; 
     32 
    3533 
    3634BEGIN { 
     
    149147    my ($handle); 
    150148    if ($self->{'debug'}) { 
    151     $handle = STDOUT; 
    152     } else { 
     149    $handle = *STDOUT; 
     150    } 
     151    else { 
    153152    if (!-e "$mg_passes_exe" ||  
    154         !open (PIPEOUT, "| mg_passes$exe -f \"$fulltextprefix\" -b $maxdocsize -T1 -M $maxnumeric $osextra")) { 
     153        !open($handle, "| mg_passes$exe -f \"$fulltextprefix\" -b $maxdocsize -T1 -M $maxnumeric $osextra")) { 
    155154        print STDERR "<FatalError name='NoRunMGPasses'>\n</Stage>\n" if $self->{'gli'}; 
    156155        die "mgbuilder::compress_text - couldn't run $mg_passes_exe\n"; 
    157156    } 
    158     $handle = mgbuilder::PIPEOUT; 
    159157    } 
    160158 
     
    398396    my ($handle); 
    399397    if ($self->{'debug'}) { 
    400     $handle = STDOUT; 
    401     } else { 
     398    $handle = *STDOUT; 
     399    } 
     400    else { 
    402401    if (!-e "$mg_passes_exe" ||  
    403         !open (PIPEOUT, "| mg_passes$exe -f \"$fullindexprefix\" -b $maxdocsize " . 
     402        !open($handle, "| mg_passes$exe -f \"$fullindexprefix\" -b $maxdocsize " . 
    404403           "-$index_level -m 32 -s 0 -G -t 10 -N1 -M $maxnumeric $osextra")) { 
    405404        print STDERR "<FatalError name='NoRunMGPasses'/>\n</Stage>\n" if $self->{'gli'}; 
    406405        die "mgbuilder::build_index - couldn't run $mg_passes_exe\n"; 
    407406    } 
    408     $handle = mgbuilder::PIPEOUT; 
    409407    } 
    410408     
     
    530528    my $input_file = &util::filename_cat ("text", $collect_tail); 
    531529    if (!-e "$mgstat_exe" || !open (PIPEIN, "mgstat$exe -d \"$self->{'build_dir'}\" -f \"$input_file\" |")) { 
     530    my $outhandle = $self->{'outhandle'}; 
    532531    print $outhandle "Warning: Couldn't open pipe to $mgstat_exe to get additional stats\n"; 
    533532    } else {