/ /home/httpd/lonUsers use strict; use Config; my $nvsize = $Config{nvsize} || ($Config{uselongdouble} && $Config{longdblsize}) || $Config{doublesize}; unless ($nvsize =~ /^\d+$/) { print "Unexpected value: $nvsize determined for nvsize from Config.pm for use in LCMathComplex.pm\n"; exit; } my $fh; my ($mathcomplex,$changed); if (open($fh,"</home/httpd/lib/perl/LONCAPA/LCMathComplex.pm")) { while (<$fh>) { if (/^\s*\Qmy $nvsize = \E(\d+);/) { my $currsize = $1; if ($currsize != $nvsize) { $changed = 1; $mathcomplex .= ' my $nvsize = '.$nvsize.';'."\n"; } else { print "nvsize in LCMathComplex.pm already set to $nvsize -- no action required.\n"; last; } } else { $mathcomplex .= $_; } } close($fh); if ($changed) { if (open($fh,">/home/httpd/lib/perl/LONCAPA/LCMathComplex.pm")) { print $fh $mathcomplex; close($fh); print "nvsize now set to $nvsize in LCMathComplex.pm\n"; } } }