From c2e3c2a0ca9dcd04d555cc6ae0bca2cc58bbd6d8 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 11 Aug 2002 17:02:50 +0000 Subject: add get_stdout (similar to rooted_get_stdout) --- perl-install/run_program.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'perl-install') diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm index 78ae48559..4fc9393f6 100644 --- a/perl-install/run_program.pm +++ b/perl-install/run_program.pm @@ -16,6 +16,13 @@ sub rooted_or_die { my ($root, $name, @args) = @_; rooted($root, $name, @args) or die "$name failed\n"; } + +sub get_stdout { + my ($name, @args) = @_; + my @r; + run($name, '>', \@r, @args) or return; + wantarray ? @r : join('', @r); +} sub rooted_get_stdout { my ($root, $name, @args) = @_; my @r; -- cgit v1.2.1