diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-06-05 12:44:48 -0500 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-06-05 12:44:48 -0500 |
commit | a158c22df50796bbf02d876d6197635a1899aba6 (patch) | |
tree | 22714fae8f37adafe1be78f8488b523edbbdcb1e /sboupgrade | |
parent | ae9bb71900fe625562c124debcf4f7b316a1bb3a (diff) | |
download | sbotools2-a158c22df50796bbf02d876d6197635a1899aba6.tar.xz |
factored out "open my $fh, $op, $file" and made it robust in one fell swoop
Diffstat (limited to 'sboupgrade')
-rwxr-xr-x | sboupgrade | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -198,13 +198,13 @@ sub readme_prompt { script_error ('readme_prompt requires an argument.') unless exists $_[0]; my $sbo = shift; my $readme_path = get_readme_path ($sbo); - open my $readme_file, '<', $readme_path; - my $readme = do {local $/; <$readme_file>}; + my $fh = open_read ($readme_path); + my $readme = do {local $/; <$fh>}; + close $fh; unless (grok_requirements ($sbo, $readme) ) { grok_user_group ($readme); my $opts = grok_options ($readme); print "\n". $readme if $opts eq "7"; - close $readme_file; my $name = $compat32 eq 'TRUE' ? "$sbo-compat32" : $sbo; print "\nProceed with $name? [y]: "; my $test = <STDIN>; |