document frec
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 7 Nov 2007 09:19:29 +0000 (09:19 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 7 Nov 2007 09:19:29 +0000 (09:19 +0000)
git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1012 07558da8-63fa-0310-ba24-9fe276d99e06

lib/WebPAC/Normalize.pm

index 9f39027..71cb43e 100644 (file)
@@ -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