summaryrefslogtreecommitdiffstats
path: root/MDK/Common/String.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-02-14 19:48:18 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-02-14 19:48:18 +0000
commitd9539a662a70ffa83fbf5decb15fd1cc628d9a0f (patch)
tree3459a377337c55b068f2904440b454ca08344b0e /MDK/Common/String.pm
parentcec3bf7ceade91064ce3d87122c5aa0967e23a55 (diff)
downloadperl-MDK-Common-d9539a662a70ffa83fbf5decb15fd1cc628d9a0f.tar
perl-MDK-Common-d9539a662a70ffa83fbf5decb15fd1cc628d9a0f.tar.gz
perl-MDK-Common-d9539a662a70ffa83fbf5decb15fd1cc628d9a0f.tar.bz2
perl-MDK-Common-d9539a662a70ffa83fbf5decb15fd1cc628d9a0f.tar.xz
perl-MDK-Common-d9539a662a70ffa83fbf5decb15fd1cc628d9a0f.zip
warp_text returns a join'ed string in scalar context
Diffstat (limited to 'MDK/Common/String.pm')
-rw-r--r--MDK/Common/String.pm3
1 files changed, 2 insertions, 1 deletions
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;