/[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 819 by dpavlin, Wed Apr 11 10:09:34 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 1021  Prefix all values with a string Line 1021  Prefix all values with a string
1021  =cut  =cut
1022    
1023  sub prefix {  sub prefix {
1024          my $p = shift or return;          my $p = shift;
1025            return @_ unless defined( $p );
1026          return map { $p . $_ } grep { defined($_) } @_;          return map { $p . $_ } grep { defined($_) } @_;
1027  }  }
1028    
# Line 1034  suffix all values with a string Line 1035  suffix all values with a string
1035  =cut  =cut
1036    
1037  sub suffix {  sub suffix {
1038          my $s = shift or die "suffix needs string as first argument";          my $s = shift;
1039            return @_ unless defined( $s );
1040          return map { $_ . $s } grep { defined($_) } @_;          return map { $_ . $s } grep { defined($_) } @_;
1041  }  }
1042    
# Line 1047  surround all values with a two strings Line 1049  surround all values with a two strings
1049  =cut  =cut
1050    
1051  sub surround {  sub surround {
1052          my $p = shift or die "surround need prefix as first argument";          my $p = shift;
1053          my $s = shift or die "surround needs suffix as second argument";          my $s = shift;
1054            $p = '' unless defined( $p );
1055            $s = '' unless defined( $s );
1056          return map { $p . $_ . $s } grep { defined($_) } @_;          return map { $p . $_ . $s } grep { defined($_) } @_;
1057  }  }
1058    

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

  ViewVC Help
Powered by ViewVC 1.1.26