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

raeburn raeburn at source.lon-capa.org
Wed Aug 23 16:39:06 EDT 2023


raeburn		Wed Aug 23 20:39:06 2023 EDT

  Modified files:              
    /loncom/homework	daxeopen.pm 
  Log:
  - Coding style.  use strict
  
  
Index: loncom/homework/daxeopen.pm
diff -u loncom/homework/daxeopen.pm:1.7 loncom/homework/daxeopen.pm:1.8
--- loncom/homework/daxeopen.pm:1.7	Wed Aug 23 20:33:06 2023
+++ loncom/homework/daxeopen.pm	Wed Aug 23 20:39:06 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Opening converted problems and directory listings for Daxe
 #
-# $Id: daxeopen.pm,v 1.7 2023/08/23 20:33:06 raeburn Exp $
+# $Id: daxeopen.pm,v 1.8 2023/08/23 20:39:06 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -28,8 +28,9 @@
 ###
 
 package Apache::daxeopen;
+use strict;
 
-use Apache::Constants;
+use Apache::Constants qw(:common);
 use DateTime;
 use Try::Tiny;
 use File::stat;
@@ -88,7 +89,7 @@
           $case_sensitive = 0;
         }
         $textref = &Apache::html_to_xml::html_to_xml($textref, $warnings, $case_sensitive);
-        my $text = &Apache::post_xml::post_xml($textref, $file, $perlvar{'lonDocRoot'}, $warnings);
+        my $text = &Apache::post_xml::post_xml($textref, $file, $Apache::lonnet::perlvar{'lonDocRoot'}, $warnings);
         &Apache::loncommon::content_type($request, 'text/xml', 'utf-8');
         $request->print($text);
         return OK;
@@ -115,7 +116,7 @@
         return OK;
     } elsif ($uri =~ m{^/res/}) {
         # NOTE: dirlist does not return an error for /res/idontexist/
-	(my $listref, $listerror) = &Apache::lonnet::dirlist($uri);
+	my ($listref, $listerror) = &Apache::lonnet::dirlist($uri);
 	if ($listerror) {
             $request->content_type('text/plain');
             $request->print("listing error: $listerror");
@@ -213,7 +214,7 @@
             if ($name =~ /\.(bak|log|meta|save)$/) {
                 next;
             }
-            $sb = stat($dirpath.'/'.$name);
+            my $sb = stat($dirpath.'/'.$name);
             my $mode = $sb->mode;
             if (S_ISDIR($mode)) {
                 $res .= "<directory name=\"$name\"/>\n";




More information about the LON-CAPA-cvs mailing list