From d9539a662a70ffa83fbf5decb15fd1cc628d9a0f Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 14 Feb 2002 19:48:18 +0000 Subject: warp_text returns a join'ed string in scalar context --- MDK/Common/String.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'MDK/Common') diff --git a/MDK/Common/String.pm b/MDK/Common/String.pm index 6a4b451..2894c2b 100644 --- a/MDK/Common/String.pm +++ b/MDK/Common/String.pm @@ -43,6 +43,7 @@ an empty line =item warp_text(STRING, INT) return a list of lines which do not exceed INT characters +(or a string in scalar context) =item warp_text(STRING) @@ -147,7 +148,7 @@ sub warp_text { } push @l, "$beg$t"; } - @l; + wantarray ? @l : join("\n", @l); } 1; -- cgit v1.2.1