qsos-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qsos-commits] qsos/tools/showtemplate showtemplate.pl


From: Gonéri Le Bouder
Subject: [Qsos-commits] qsos/tools/showtemplate showtemplate.pl
Date: Fri, 19 May 2006 10:33:45 +0000

CVSROOT:        /sources/qsos
Module name:    qsos
Branch:         
Changes by:     Gonéri Le Bouder <address@hidden>      06/05/19 10:33:45

Modified files:
        tools/showtemplate: showtemplate.pl 

Log message:
        minor fix

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qsos/qsos/tools/showtemplate/showtemplate.pl.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: qsos/tools/showtemplate/showtemplate.pl
diff -u qsos/tools/showtemplate/showtemplate.pl:1.4 
qsos/tools/showtemplate/showtemplate.pl:1.5
--- qsos/tools/showtemplate/showtemplate.pl:1.4 Mon Apr 24 16:20:01 2006
+++ qsos/tools/showtemplate/showtemplate.pl     Fri May 19 10:33:45 2006
@@ -23,8 +23,14 @@
 }
 
 my $inheader;
-open FILE,"<".$file or die "can't open $file: $!";
-foreach(<FILE>) {
+if (open FILE,"<".$file) {
+  undef $/;
+  my $content = <FILE>;
+  close FILE or die;
+} else {
+  die "can't open $file: $!";
+}
+  s!\r!!g;
 
   $inheader = 1 if (/<header>/);
   $inheader = undef if (/<\/header>/);
@@ -43,12 +49,11 @@
     s!(<desc>).+(<\/desc>)!$1$2!g;
   }
 
-  s!(<comment>).+(<\/comment>)!$1$2!g;
+  s!(<comment>)[\n.]+(</comment>)!$1$2!g;
   s!(<score>).+(</score>)!$1$2!g;
   s!<\!--.+-->!!g;
   s!>[\ \t]+$!>!g;
   chomp if (s!^[\t\ ]{0,}$!!);
-  print;
   if ($global && /<\/section>/) {
     print "</document>\n";
     last;
@@ -56,5 +61,3 @@
 }
 
 
-close FILE or die;
-




reply via email to

[Prev in Thread] Current Thread [Next in Thread]