--- trunk/lib/WebPAC/Normalize.pm 2007/11/06 20:26:31 1011 +++ trunk/lib/WebPAC/Normalize.pm 2007/11/07 09:19:29 1012 @@ -1000,12 +1000,6 @@ =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 @@ } } +=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