/[webpac2]/trunk/lib/WebPAC/Normalize.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Normalize.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 817 by dpavlin, Thu Apr 5 21:50:14 2007 UTC revision 831 by dpavlin, Wed May 23 20:03:14 2007 UTC
# Line 42  WebPAC::Normalize - describe normalisato Line 42  WebPAC::Normalize - describe normalisato
42    
43  =head1 VERSION  =head1 VERSION
44    
45  Version 0.28  Version 0.29
46    
47  =cut  =cut
48    
49  our $VERSION = '0.28';  our $VERSION = '0.29';
50    
51  =head1 SYNOPSIS  =head1 SYNOPSIS
52    
# Line 872  sub _pack_subfields_hash { Line 872  sub _pack_subfields_hash {
872    
873          my ($h,$include_subfields) = @_;          my ($h,$include_subfields) = @_;
874    
875            # sanity and ease of use
876            return $h if (ref($h) ne 'HASH');
877    
878          if ( defined($h->{subfields}) ) {          if ( defined($h->{subfields}) ) {
879                  my $sfs = delete $h->{subfields} || die "no subfields?";                  my $sfs = delete $h->{subfields} || die "no subfields?";
880                  my @out;                  my @out;
# Line 1021  Prefix all values with a string Line 1024  Prefix all values with a string
1024  =cut  =cut
1025    
1026  sub prefix {  sub prefix {
1027          my $p = shift or return;          my $p = shift;
1028            return @_ unless defined( $p );
1029          return map { $p . $_ } grep { defined($_) } @_;          return map { $p . $_ } grep { defined($_) } @_;
1030  }  }
1031    
# Line 1034  suffix all values with a string Line 1038  suffix all values with a string
1038  =cut  =cut
1039    
1040  sub suffix {  sub suffix {
1041          my $s = shift or die "suffix needs string as first argument";          my $s = shift;
1042            return @_ unless defined( $s );
1043          return map { $_ . $s } grep { defined($_) } @_;          return map { $_ . $s } grep { defined($_) } @_;
1044  }  }
1045    
# Line 1047  surround all values with a two strings Line 1052  surround all values with a two strings
1052  =cut  =cut
1053    
1054  sub surround {  sub surround {
1055          my $p = shift or die "surround need prefix as first argument";          my $p = shift;
1056          my $s = shift or die "surround needs suffix as second argument";          my $s = shift;
1057            $p = '' unless defined( $p );
1058            $s = '' unless defined( $s );
1059          return map { $p . $_ . $s } grep { defined($_) } @_;          return map { $p . $_ . $s } grep { defined($_) } @_;
1060  }  }
1061    

Legend:
Removed from v.817  
changed lines
  Added in v.831

  ViewVC Help
Powered by ViewVC 1.1.26