From ef476f0d32d85529d0bf6a15af5de7a7c0db1f06 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sun, 11 Mar 2012 20:46:31 +0530 Subject: [PATCH] common: slurp() learns to look at wantarray --- src/Gitolite/Common.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Gitolite/Common.pm b/src/Gitolite/Common.pm index d2f2cea..3ac2301 100644 --- a/src/Gitolite/Common.pm +++ b/src/Gitolite/Common.pm @@ -127,7 +127,8 @@ sub _print { } sub slurp { - local $/ = undef; + return unless defined wantarray; + local $/ = undef unless wantarray; my $fh = _open( "<", $_[0] ); return <$fh>; }