From 68fbc16b85fc22ad7c95922325748a2bc48fbdac Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 1 Jul 2008 10:46:59 +0000 Subject: add append_to_file() --- urpm/util.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'urpm') diff --git a/urpm/util.pm b/urpm/util.pm index 0af9cc53..0a7bbd00 100644 --- a/urpm/util.pm +++ b/urpm/util.pm @@ -14,7 +14,7 @@ our @EXPORT = qw(min max quotespace unquotespace partition put_in_hash uniq uniq_ begins_with difference2 intersection member - file_size cat_ cat_utf8 output_safe dirname basename + file_size cat_ cat_utf8 output_safe append_to_file dirname basename ); (our $VERSION) = q($Revision$) =~ /(\d+)/; @@ -161,6 +161,13 @@ sub output_safe { 1; } +sub append_to_file { + my $f = shift; + open(my $F, '>>', $f) or die "writing to file $f failed: $!\n"; + print $F $_ foreach @_; + 1; +} + 1; __END__ -- cgit v1.2.1