[Koha-cvs] koha/C4 Labels.pm [dev_week]

Mason James szrj1m at yahoo.com
Tue Jan 29 06:08:09 CET 2008


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Mason James <sushi>	08/01/29 05:08:09

Modified files:
	C4             : Labels.pm 

Log message:
	better regexs in split_lccn().

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Labels.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.3.4.56&r2=1.3.4.57

Patches:
Index: Labels.pm
===================================================================
RCS file: /sources/koha/koha/C4/Labels.pm,v
retrieving revision 1.3.4.56
retrieving revision 1.3.4.57
diff -u -b -r1.3.4.56 -r1.3.4.57
--- Labels.pm	22 Oct 2007 05:02:33 -0000	1.3.4.56
+++ Labels.pm	29 Jan 2008 05:08:09 -0000	1.3.4.57
@@ -27,7 +27,7 @@
 use Algorithm::CheckDigits;
 
 # use Data::Dumper;
- use Smart::Comments '###';
+# use Smart::Comments '###';
 
 $VERSION = 0.01;
 
@@ -113,12 +113,11 @@
 sub split_lccn {
     my ($lccn) = @_;    
     my ( $ll, $wnl, $dec, $cutter, $pubdate);
-
     $_ = $lccn;
 
 # lccn example 'HE8700.7 .P6T44 1983';
     my @splits   = m/
-        ([a-zA-Z]+\s*)             # HE (with spaces)
+        (^[a-zA-Z]{2})             # 'HE' 
         ([0-9]+\.*[0-9]+\s*)    # 8700.7 or 8700 without '.', 
                                 # handles trailing space too
         (\.[a-zA-Z0-9]+\s*)        #.P6T44
@@ -132,7 +131,7 @@
 
 # if the regex fails, then just return the whole string, 
 # better than nothing
-$splits[0] = $lccn if  $splits[0]  eq '' ;
+ $splits[0] = $lccn if  $splits[0]  eq '' ;
     return @splits;
 }
 
@@ -869,7 +868,7 @@
                 $hPos = $x_pos + $label_width - ( $gutter + $strwidth );
             }
 
-            warn "HPOS ,  VPOS $hPos, $vPos\n";
+          #  warn "HPOS ,  VPOS $hPos, $vPos\n";
 
             # set the font size A
       #      $str =~ s/^\*$/ /;





More information about the Koha-cvs mailing list