From d44ddf7b6cf98d3bfc1e65ec9600061c8407cc91 Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Sun, 28 Aug 2016 21:45:11 +0200 Subject: sboconfig: move slurp() to SBO::Lib::Util, and document it --- sboconfig | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'sboconfig') diff --git a/sboconfig b/sboconfig index ca6d1fa..604a816 100755 --- a/sboconfig +++ b/sboconfig @@ -13,7 +13,7 @@ use 5.16.0; use strict; use warnings FATAL => 'all'; -use SBO::Lib qw/ usage_error script_error $tempdir open_read open_fh %config $conf_dir $conf_file show_version /; +use SBO::Lib qw/ slurp usage_error script_error $tempdir open_fh %config $conf_dir $conf_file show_version /; use File::Basename; use Getopt::Long qw(:config no_ignore_case_always); use File::Copy; @@ -158,15 +158,6 @@ sub config_write { print {$conffh} $conf; } -sub slurp { - my $fn = shift; - return undef unless -f $fn; - my ($fh, $exit) = open_read($fn); - return undef if $exit; - local $/; - return scalar readline($fh); -} - # make sure there are no duplicate keys in the config sub _fixup_conf { my @lines = split /\n/, $_[0]; -- cgit v1.2.3