commit b58cbbf013d913355f8d814ce1144f1b2eea8271 parent 5795cfaede7a9a4709f7c618323c5ab0084c94fd Author: Andreas Guldstrand <andreas.guldstrand@gmail.com> Date: Sat, 16 Apr 2016 19:40:15 +0200 Use indent() to indent contents of files Diffstat:
| M | sbofind | | | 8 | ++------ |
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sbofind b/sbofind @@ -13,7 +13,7 @@ use 5.16.0; use strict; use warnings FATAL => 'all'; -use SBO::Lib qw/ slackbuilds_or_fetch script_error open_read get_build_queue %config $slackbuilds_txt $repo_path show_version in /; +use SBO::Lib qw/ slackbuilds_or_fetch script_error open_read get_build_queue %config $slackbuilds_txt $repo_path show_version in indent /; use File::Basename; use Getopt::Long qw(:config bundling); @@ -138,11 +138,7 @@ sub get_file_contents { return(); } my $contents = do {local $/; <$fh>}; - for ($contents) { - s/\n/\n /g; - s/\n $//g; - } - return $contents; + return "\n" . indent 6, $contents; } # get build queue and return it as a single line.