Changeset 745

Show
Ignore:
Timestamp:
01/16/08 01:42:54 (23 months ago)
Author:
ask
Message:

use a locally scoped filehandle instead of a typeglob in load_config()

(from Eamon Daly,
Message-Id: <037e01c857c5$2b7ceb80$69fea8c0@EDALYLAPTOP>)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Perlbal.pm

    r742 r745  
    11601160sub load_config { 
    11611161    my ($file, $writer) = @_; 
    1162     open (F, $file) or die "Error opening config file ($file): $!\n"; 
     1162    open (my $fh, $file) or die "Error opening config file ($file): $!\n"; 
    11631163    my $ctx = Perlbal::CommandContext->new; 
    11641164    $ctx->verbose(0); 
    1165     while (my $line = <F>) { 
     1165    while (my $line = <$fh>) { 
    11661166        $line =~ s/\$(\w+)/$ENV{$1}/g; 
    11671167        return 0 unless run_manage_command($line, $writer, $ctx); 
    11681168    } 
    1169     close(F); 
     1169    close($fh); 
    11701170    return 1; 
    11711171}