From b7e1da6ee557b9968170d7abcfde7da48f8ec0ba Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 7 Nov 2007 09:19:29 +0000 Subject: [PATCH] document frec git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1012 07558da8-63fa-0310-ba24-9fe276d99e06 --- lib/WebPAC/Normalize.pm | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/WebPAC/Normalize.pm b/lib/WebPAC/Normalize.pm index 9f39027..71cb43e 100644 --- a/lib/WebPAC/Normalize.pm +++ b/lib/WebPAC/Normalize.pm @@ -1000,12 +1000,6 @@ return scalar, not array. =cut -sub frec { - my @out = rec(@_); - warn "rec(",dump(@_),") has more than one return value, ignoring\n" if $#out > 0; - return shift @out; -} - sub rec { my @out; if ($#_ == 0) { @@ -1022,6 +1016,21 @@ sub rec { } } +=head2 frec + +Returns first value from field + + $v = frec('200'); + $v = frec('200','a'); + +=cut + +sub frec { + my @out = rec(@_); + warn "rec(",dump(@_),") has more than one return value, ignoring\n" if $#out > 0; + return shift @out; +} + =head2 regex Apply regex to some or all values -- 2.20.1