[LON-CAPA-cvs] cvs: loncom /homework randomlabel.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 08 Jan 2004 20:28:20 -0000


albertel		Thu Jan  8 15:28:20 2004 EDT

  Modified files:              
    /loncom/homework	randomlabel.pm 
  Log:
  - trying to make the regexps readable
  
  
Index: loncom/homework/randomlabel.pm
diff -u loncom/homework/randomlabel.pm:1.54 loncom/homework/randomlabel.pm:1.55
--- loncom/homework/randomlabel.pm:1.54	Thu Jan  8 15:05:13 2004
+++ loncom/homework/randomlabel.pm	Thu Jan  8 15:28:20 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # random labelling tool
 #
-# $Id: randomlabel.pm,v 1.54 2004/01/08 20:05:13 sakharuk Exp $
+# $Id: randomlabel.pm,v 1.55 2004/01/08 20:28:20 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -107,8 +107,8 @@
 	my $newbgimg = $bgimg;
 	$bgimg=~s/\.(gif|jpg|png|jpeg)$/\.eps/i;
 	$bgimg= &Apache::lonnet::filelocation($bgimg);
-	$bgimg=~s/http:\/[^\/]*/\/home\/httpd\/html/;
-	$bgimg=~s/\/$//;
+	$bgimg=~s|http:/[^/]*//home/httpd/html|;
+	$bgimg=~s|/$||;
 	#if no eps file try to replicate it
 	if (not-e $bgimg) {
 	    if (&Apache::lonnet::repcopy($bgimg) ne OK ) {
@@ -122,14 +122,14 @@
 		    my $temp_file;
 		    my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat";
 		    $temp_file = Apache::File->new('>>'.$filename);
-		    $newbgimg =~ s/(.*)\/res\//\/home\/httpd\/html\/res\//;
+		    $newbgimg =~ s|(.*)/res/|/home/httpd/html/res/|;
 		    print $temp_file "$newbgimg\n";
-		    $bgimg=~s/\/home\/httpd\/html\/res/\/home\/httpd\/prtspool/;
-		    $bgimg=~s|\/home\/([^\/]*)\/public_html\/|\/home\/httpd\/prtspool\/$1\/|;
+		    $bgimg=~s|/home/httpd/html/res|/home/httpd/prtspool|;
+		    $bgimg=~s|/home/([^/]*)/public_html/|/home/httpd/prtspool/$1/|;
 		}
 	    }
 	}
-	$bgimg=~s/\/$//;
+	$bgimg=~s|/$||;
 	my $dirtywidth=$texwidth+5;
 	$result.='\vspace*{2mm}\noindent \parbox{'.$dirtywidth.' mm}{  \noindent \epsfxsize='.
 	    $texwidth.' mm \epsffile{'.$bgimg.'}\setlength{\unitlength}{1mm}  \begin{picture}('.