--- loncom/homework/daxeopen.pm 2023/08/23 20:33:06 1.7 +++ loncom/homework/daxeopen.pm 2023/08/23 20:39:06 1.8 @@ -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 @@ sub convert_problem { $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 @@ sub directory_listing { 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 @@ sub directory_listing { 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 .= "\n";