Use proper open()'s

This commit is contained in:
Elijah Perrault committed 2011-01-22 22:32:41 -07:00
1 parent 1d9ef3776d
commit b922617203
1 file changed
+6 -6
+6 -6
View File
@@ -21,9 +21,9 @@ sub new
} }
# Open, read and close the config. # Open, read and close the config.
open CONF, "<$Auto::Bin/../etc/$file" or return 0; open(my $FCONF, q{<}, "$Auto::Bin/../etc/$file") or return 0;
my @cosfl = <CONF> or return 0; my @cosfl = <$FCONF> or return 0;
close CONF or return 0; close $FCONF or return 0;
# Save it to self variable. # Save it to self variable.
$self->{'config'}->{'path'} = "$Auto::Bin/../etc/$file"; $self->{'config'}->{'path'} = "$Auto::Bin/../etc/$file";
@@ -41,9 +41,9 @@ sub parse
my (%rs); my (%rs);
# Open, read and close it. # Open, read and close it.
open CONF, "<$file" or return 0; open(my $FCONF, q{<}, "$file") or return 0;
my @fbuf = <CONF> or return 0; my @fbuf = <$FCONF> or return 0;
close CONF or return 0; close $FCONF or return 0;
# Iterate the file. # Iterate the file.
foreach my $buff (@fbuf) { foreach my $buff (@fbuf) {