-1) {
+ # $colspec[$#colspec] .= join('', "",$celldata,' | ');
+@@ -794,9 +792,7 @@ sub translate_colspec {
+ }
+ $celldata .= ' ' if ($celldata =~ /\\\w+$/);
+
+- $* = 1; # multiline matching ON
+- $celldata =~ s/$wrap_parbox_rx/$6/g;
+- $* = 0; # multiline matching OFF
++ $celldata =~ s/$wrap_parbox_rx/$6/gm;
+ $at_text .= $celldata;
+
+ } elsif ( $char =~ /;|\&/ ) {
+@@ -965,9 +961,7 @@ sub process_tabular {
+
+ while (/\\parbox/) {
+ local($parlength) = length($_);
+- $* = 1; # multiline matching ON
+- s/$wrap_parbox_rx/&convert_parbox_newlines($6)/eg;
+- $* = 0; # multiline matching OFF
++ s/$wrap_parbox_rx/&convert_parbox_newlines($6)/egm;
+
+ if ($parlength == length($_)) {
+ print "\n*** \\parbox's remain in table!!\n";
+@@ -1196,9 +1190,7 @@ sub process_tabular {
+ }
+ $colspec = &translate_environments("$OP$tmp$CP$colspec$OP$tmp$CP");
+ $colspec = &translate_commands($colspec);
+- $* = 1;
+- while ($colspec =~ s/<(\w+)>\s*<\/\1>//g) {};
+- $* = 0;
++ while ($colspec =~ s/<(\w+)>\s*<\/\1>//gm) {};
+ $colspec = ';SPMnbsp;' if ($colspec =~ /^\s*$/);
+ $colspec = join('', $reopens, $colspec
+ , (@$open_tags_R ? &close_all_tags() : '')
+@@ -1338,7 +1330,7 @@ sub make_math_comment{
+ $ecomm = "\n\\end{$env}";
+ } unless ($env =~/tex2html/);
+ $_ = &revert_to_raw_tex;
+- $* = 1; s/^\s+//s; s/\s+$//s; $* = 0;
++ s/^\s+//s; s/\s+$//sm;
+ $_ = $scomm . $_ . $ecomm;
+ return() if (length($_) < 16);
+ $global{'verbatim_counter'}++;
+@@ -1440,20 +1432,19 @@ sub do_env_equation {
+ local($seqno) = join('',"\n\n");
+- $* = 1;
+ do { # get the equation number
+ $global{'eqn_number'}++;
+ $eqno = &translate_commands('\theequation');
+- } unless ((s/(\\nonumber|\\notag)//g)||(/\\tag/));
++ } unless ((s/(\\nonumber|\\notag)//gm)||(/\\tag/));
+ if (/\\tag(\*)?/){
+ # AmS-TEX line-number tags.
+ if (defined &get_eqn_number ) {
+ ($eqno, $_) = &get_eqn_number(1,$_);
+ } else {
+- s/\\tag(\*)?//;
++ s/\\tag(\*)?//m;
+ local($nobrack,$before) = ($1,$`);
+ $_ = $';
+- s/next_pair_pr_rx//o;
++ s/next_pair_pr_rx//om;
+ if ($nobrack) { $eqno = $2; }
+ else { $eqno = join('',$EQNO_START, $2, $EQNO_END) };
+ $_ = $before;
+@@ -1461,7 +1452,6 @@ sub do_env_equation {
+ } elsif ($eqno) {
+ $eqno = join('',$EQNO_START, $eqno, $EQNO_END)
+ } else { $eqno = ' ' } # spacer, when no numbering
+- $* = 0;
+
+ # include the equation-number, using a
+ local($halign) = " ALIGN=\"CENTER\"" unless $FLUSH_EQN;
+@@ -1641,7 +1631,7 @@ sub do_env_eqnarray {
+ # if (s/\\lefteqn$OP(\d+)$CP(.*)$OP\1$CP/ $2 /) {
+ if (s/\\lefteqn//) {
+ $return .= "\"LEFT\" COLSPAN=\"3\">";
+- $* =1; s/(^\s*|$html_specials{'&'}|\s*$)//g; $*=0;
++ s/(^\s*|$html_specials{'&'}|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $_ = (($_)? &process_math_in_latex(
+ "indisplay" , '', '', $doimage.$_ ):'');
+@@ -1666,7 +1656,7 @@ sub do_env_eqnarray {
+
+ # left column, set using \displaystyle
+ $thismath = shift(@cols); $failed = 0;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $thismath = (($thismath ne '')? &process_math_in_latex(
+ "indisplay" , '', '', $doimage.$thismath ):'');
+@@ -1686,7 +1676,7 @@ sub do_env_eqnarray {
+
+ # center column, set using \textstyle
+ $thismath = shift(@cols); $failed = 0;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $thismath = (($thismath ne '')? &process_math_in_latex(
+ "indisplay" , 'text', '', $doimage.$thismath ):'');
+@@ -1706,7 +1696,7 @@ sub do_env_eqnarray {
+
+ # right column, set using \displaystyle
+ $thismath = shift(@cols); $failed = 0;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $thismath = (($thismath ne '')? &process_math_in_latex(
+ "indisplay" , '', '', $doimage.$thismath ):'');
+Index: latex2html-2008/versions/html4_01.pl
+===================================================================
+--- latex2html-2008.orig/versions/html4_01.pl
++++ latex2html-2008/versions/html4_01.pl
+@@ -766,9 +766,7 @@ sub translate_colspec {
+ }
+ $celldata .= ' ' if ($celldata =~ /\\\w+$/);
+
+- $* = 1; # multiline matching ON
+- $celldata =~ s/$wrap_parbox_rx/$6/g;
+- $* = 0; # multiline matching OFF
++ $celldata =~ s/$wrap_parbox_rx/$6/gm;
+ # $at_text .= $celldata;
+ # if ( $#colspec > -1) {
+ # $colspec[$#colspec] .= join('', "",$celldata,' | ');
+@@ -794,9 +792,7 @@ sub translate_colspec {
+ }
+ $celldata .= ' ' if ($celldata =~ /\\\w+$/);
+
+- $* = 1; # multiline matching ON
+- $celldata =~ s/$wrap_parbox_rx/$6/g;
+- $* = 0; # multiline matching OFF
++ $celldata =~ s/$wrap_parbox_rx/$6/gm;
+ $at_text .= $celldata;
+
+ } elsif ( $char =~ /;|\&/ ) {
+@@ -965,9 +961,7 @@ sub process_tabular {
+
+ while (/\\parbox/) {
+ local($parlength) = length($_);
+- $* = 1; # multiline matching ON
+- s/$wrap_parbox_rx/&convert_parbox_newlines($6)/eg;
+- $* = 0; # multiline matching OFF
++ s/$wrap_parbox_rx/&convert_parbox_newlines($6)/egm;
+
+ if ($parlength == length($_)) {
+ print "\n*** \\parbox's remain in table!!\n";
+@@ -1196,9 +1190,7 @@ sub process_tabular {
+ }
+ $colspec = &translate_environments("$OP$tmp$CP$colspec$OP$tmp$CP");
+ $colspec = &translate_commands($colspec);
+- $* = 1;
+- while ($colspec =~ s/<(\w+)>\s*<\/\1>//g) {};
+- $* = 0;
++ while ($colspec =~ s/<(\w+)>\s*<\/\1>//gm) {};
+ $colspec = ';SPMnbsp;' if ($colspec =~ /^\s*$/);
+ $colspec = join('', $reopens, $colspec
+ , (@$open_tags_R ? &close_all_tags() : '')
+@@ -1338,7 +1330,7 @@ sub make_math_comment{
+ $ecomm = "\n\\end{$env}";
+ } unless ($env =~/tex2html/);
+ $_ = &revert_to_raw_tex;
+- $* = 1; s/^\s+//s; s/\s+$//s; $* = 0;
++ s/^\s+//s; s/\s+$//sm;
+ $_ = $scomm . $_ . $ecomm;
+ return() if (length($_) < 16);
+ $global{'verbatim_counter'}++;
+@@ -1440,20 +1432,19 @@ sub do_env_equation {
+ local($seqno) = join('',"\n\n");
+- $* = 1;
+ do { # get the equation number
+ $global{'eqn_number'}++;
+ $eqno = &translate_commands('\theequation');
+- } unless ((s/(\\nonumber|\\notag)//g)||(/\\tag/));
++ } unless ((s/(\\nonumber|\\notag)//gm)||(/\\tag/));
+ if (/\\tag(\*)?/){
+ # AmS-TEX line-number tags.
+ if (defined &get_eqn_number ) {
+ ($eqno, $_) = &get_eqn_number(1,$_);
+ } else {
+- s/\\tag(\*)?//;
++ s/\\tag(\*)?//m;
+ local($nobrack,$before) = ($1,$`);
+ $_ = $';
+- s/next_pair_pr_rx//o;
++ s/next_pair_pr_rx//om;
+ if ($nobrack) { $eqno = $2; }
+ else { $eqno = join('',$EQNO_START, $2, $EQNO_END) };
+ $_ = $before;
+@@ -1461,7 +1452,6 @@ sub do_env_equation {
+ } elsif ($eqno) {
+ $eqno = join('',$EQNO_START, $eqno, $EQNO_END)
+ } else { $eqno = ' ' } # spacer, when no numbering
+- $* = 0;
+
+ # include the equation-number, using a
+ local($halign) = " ALIGN=\"CENTER\"" unless $FLUSH_EQN;
+@@ -1641,7 +1631,7 @@ sub do_env_eqnarray {
+ # if (s/\\lefteqn$OP(\d+)$CP(.*)$OP\1$CP/ $2 /) {
+ if (s/\\lefteqn//) {
+ $return .= "\"LEFT\" COLSPAN=\"3\">";
+- $* =1; s/(^\s*|$html_specials{'&'}|\s*$)//g; $*=0;
++ s/(^\s*|$html_specials{'&'}|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $_ = (($_)? &process_math_in_latex(
+ "indisplay" , '', '', $doimage.$_ ):'');
+@@ -1666,7 +1656,7 @@ sub do_env_eqnarray {
+
+ # left column, set using \displaystyle
+ $thismath = shift(@cols); $failed = 0;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $thismath = (($thismath ne '')? &process_math_in_latex(
+ "indisplay" , '', '', $doimage.$thismath ):'');
+@@ -1686,7 +1676,7 @@ sub do_env_eqnarray {
+
+ # center column, set using \textstyle
+ $thismath = shift(@cols); $failed = 0;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $thismath = (($thismath ne '')? &process_math_in_latex(
+ "indisplay" , 'text', '', $doimage.$thismath ):'');
+@@ -1706,7 +1696,7 @@ sub do_env_eqnarray {
+
+ # right column, set using \displaystyle
+ $thismath = shift(@cols); $failed = 0;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $thismath = (($thismath ne '')? &process_math_in_latex(
+ "indisplay" , '', '', $doimage.$thismath ):'');
+Index: latex2html-2008/versions/html3_2.pl
+===================================================================
+--- latex2html-2008.orig/versions/html3_2.pl
++++ latex2html-2008/versions/html3_2.pl
+@@ -406,9 +406,7 @@ sub translate_colspec {
+ }
+ $celldata .= ' ' if ($celldata =~ /\\\w+$/);
+
+- $* = 1; # multiline matching ON
+- $celldata =~ s/$wrap_parbox_rx/$6/g;
+- $* = 0; # multiline matching OFF
++ $celldata =~ s/$wrap_parbox_rx/$6/gm;
+ # $at_text .= $celldata;
+ # if ( $#colspec > -1) {
+ # $colspec[$#colspec] .= join('', "",$celldata,' | ');
+@@ -434,9 +432,7 @@ sub translate_colspec {
+ }
+ $celldata .= ' ' if ($celldata =~ /\\\w+$/);
+
+- $* = 1; # multiline matching ON
+- $celldata =~ s/$wrap_parbox_rx/$6/g;
+- $* = 0; # multiline matching OFF
++ $celldata =~ s/$wrap_parbox_rx/$6/gm;
+ $at_text .= $celldata;
+
+ } elsif ( $char =~ /;|\&/ ) {
+@@ -596,9 +592,7 @@ sub process_tabular {
+
+ while (/\\parbox/) {
+ local($parlength) = length($_);
+- $* = 1; # multiline matching ON
+- s/$wrap_parbox_rx/&convert_parbox_newlines($6)/eg;
+- $* = 0; # multiline matching OFF
++ s/$wrap_parbox_rx/&convert_parbox_newlines($6)/egm;
+
+ if ($parlength == length($_)) {
+ print "\n*** \\parbox's remain in table!!\n";
+@@ -823,9 +817,7 @@ sub process_tabular {
+ }
+ $colspec = &translate_environments("$OP$tmp$CP$colspec$OP$tmp$CP");
+ $colspec = &translate_commands($colspec);
+- $* = 1;
+- while ($colspec =~ s/<(\w+)>\s*<\/\1>//g) {};
+- $* = 0;
++ while ($colspec =~ s/<(\w+)>\s*<\/\1>//gm) {};
+ $colspec = ';SPMnbsp;' if ($colspec =~ /^\s*$/);
+ $colspec = join('', $reopens, $colspec
+ , (@$open_tags_R ? &close_all_tags() : '')
+@@ -966,7 +958,7 @@ sub make_math_comment{
+ $ecomm = "\n\\end{$env}";
+ } unless ($env =~/tex2html/);
+ $_ = &revert_to_raw_tex;
+- $* = 1; s/^\s+//s; s/\s+$//s; $* = 0;
++ s/^\s+//s; s/\s+$//sm;
+ $_ = $scomm . $_ . $ecomm;
+ return() if (length($_) < 16);
+ $global{'verbatim_counter'}++;
+@@ -1057,20 +1049,19 @@ sub do_env_equation {
+ local($seqno) = join('',"\n\n");
+- $* = 1;
+ do { # get the equation number
+ $global{'eqn_number'}++;
+ $eqno = &translate_commands('\theequation');
+- } unless ((s/(\\nonumber|\\notag)//g)||(/\\tag/));
++ } unless ((s/(\\nonumber|\\notag)//gm)||(/\\tag/));
+ if (/\\tag(\*)?/){
+ # AmS-TEX line-number tags.
+ if (defined &get_eqn_number ) {
+ ($eqno, $_) = &get_eqn_number(1,$_);
+ } else {
+- s/\\tag(\*)?//;
++ s/\\tag(\*)?//m;
+ local($nobrack,$before) = ($1,$`);
+ $_ = $';
+- s/next_pair_pr_rx//o;
++ s/next_pair_pr_rx//om;
+ if ($nobrack) { $eqno = $2; }
+ else { $eqno = join('',$EQNO_START, $2, $EQNO_END) };
+ $_ = $before;
+@@ -1078,7 +1069,6 @@ sub do_env_equation {
+ } elsif ($eqno) {
+ $eqno = join('',$EQNO_START, $eqno, $EQNO_END)
+ } else { $eqno = ' ' } # spacer, when no numbering
+- $* = 0;
+
+ # include the equation-number, using a
+ local($halign) = $math_class unless $FLUSH_EQN;
+@@ -1255,7 +1245,7 @@ sub do_env_eqnarray {
+ # if (s/\\lefteqn$OP(\d+)$CP(.*)$OP\1$CP/ $2 /) {
+ if (s/\\lefteqn//) {
+ $return .= "\"LEFT\" COLSPAN=\"3\">";
+- $* =1; s/(^\s*|$html_specials{'&'}|\s*$)//g; $*=0;
++ s/(^\s*|$html_specials{'&'}|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $_ = (($_)? &process_math_in_latex(
+ "indisplay" , '', '', $doimage.$_ ):'');
+@@ -1280,7 +1270,7 @@ sub do_env_eqnarray {
+
+ # left column, set using \displaystyle
+ $thismath = shift(@cols); $failed = 0;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $thismath = (($thismath ne '')? &process_math_in_latex(
+ "indisplay" , '', '', $doimage.$thismath ):'');
+@@ -1300,7 +1290,7 @@ sub do_env_eqnarray {
+
+ # center column, set using \textstyle
+ $thismath = shift(@cols); $failed = 0;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $thismath = (($thismath ne '')? &process_math_in_latex(
+ "indisplay" , 'text', '', $doimage.$thismath ):'');
+@@ -1320,7 +1310,7 @@ sub do_env_eqnarray {
+
+ # right column, set using \displaystyle
+ $thismath = shift(@cols); $failed = 0;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $thismath = (($thismath ne '')? &process_math_in_latex(
+ "indisplay" , '', '', $doimage.$thismath ):'');
+Index: latex2html-2008/versions/html4_0.pl
+===================================================================
+--- latex2html-2008.orig/versions/html4_0.pl
++++ latex2html-2008/versions/html4_0.pl
+@@ -745,9 +745,7 @@ sub translate_colspec {
+ }
+ $celldata .= ' ' if ($celldata =~ /\\\w+$/);
+
+- $* = 1; # multiline matching ON
+- $celldata =~ s/$wrap_parbox_rx/$6/g;
+- $* = 0; # multiline matching OFF
++ $celldata =~ s/$wrap_parbox_rx/$6/gm;
+ # $at_text .= $celldata;
+ # if ( $#colspec > -1) {
+ # $colspec[$#colspec] .= join('', "",$celldata,' | ');
+@@ -773,9 +771,7 @@ sub translate_colspec {
+ }
+ $celldata .= ' ' if ($celldata =~ /\\\w+$/);
+
+- $* = 1; # multiline matching ON
+- $celldata =~ s/$wrap_parbox_rx/$6/g;
+- $* = 0; # multiline matching OFF
++ $celldata =~ s/$wrap_parbox_rx/$6/gm;
+ $at_text .= $celldata;
+
+ } elsif ( $char =~ /;|\&/ ) {
+@@ -944,9 +940,7 @@ sub process_tabular {
+
+ while (/\\parbox/) {
+ local($parlength) = length($_);
+- $* = 1; # multiline matching ON
+- s/$wrap_parbox_rx/&convert_parbox_newlines($6)/eg;
+- $* = 0; # multiline matching OFF
++ s/$wrap_parbox_rx/&convert_parbox_newlines($6)/egm;
+
+ if ($parlength == length($_)) {
+ print "\n*** \\parbox's remain in table!!\n";
+@@ -1175,9 +1169,7 @@ sub process_tabular {
+ }
+ $colspec = &translate_environments("$OP$tmp$CP$colspec$OP$tmp$CP");
+ $colspec = &translate_commands($colspec);
+- $* = 1;
+- while ($colspec =~ s/<(\w+)>\s*<\/\1>//g) {};
+- $* = 0;
++ while ($colspec =~ s/<(\w+)>\s*<\/\1>//gm) {};
+ $colspec = ';SPMnbsp;' if ($colspec =~ /^\s*$/);
+ $colspec = join('', $reopens, $colspec
+ , (@$open_tags_R ? &close_all_tags() : '')
+@@ -1317,7 +1309,7 @@ sub make_math_comment{
+ $ecomm = "\n\\end{$env}";
+ } unless ($env =~/tex2html/);
+ $_ = &revert_to_raw_tex;
+- $* = 1; s/^\s+//s; s/\s+$//s; $* = 0;
++ s/^\s+//s; s/\s+$//sm;
+ $_ = $scomm . $_ . $ecomm;
+ return() if (length($_) < 16);
+ $global{'verbatim_counter'}++;
+@@ -1419,20 +1411,19 @@ sub do_env_equation {
+ local($seqno) = join('',"\n\n");
+- $* = 1;
+ do { # get the equation number
+ $global{'eqn_number'}++;
+ $eqno = &translate_commands('\theequation');
+- } unless ((s/(\\nonumber|\\notag)//g)||(/\\tag/));
++ } unless ((s/(\\nonumber|\\notag)//gm)||(/\\tag/));
+ if (/\\tag(\*)?/){
+ # AmS-TEX line-number tags.
+ if (defined &get_eqn_number ) {
+ ($eqno, $_) = &get_eqn_number(1,$_);
+ } else {
+- s/\\tag(\*)?//;
++ s/\\tag(\*)?//m;
+ local($nobrack,$before) = ($1,$`);
+ $_ = $';
+- s/next_pair_pr_rx//o;
++ s/next_pair_pr_rx//om;
+ if ($nobrack) { $eqno = $2; }
+ else { $eqno = join('',$EQNO_START, $2, $EQNO_END) };
+ $_ = $before;
+@@ -1440,7 +1431,6 @@ sub do_env_equation {
+ } elsif ($eqno) {
+ $eqno = join('',$EQNO_START, $eqno, $EQNO_END)
+ } else { $eqno = ' ' } # spacer, when no numbering
+- $* = 0;
+
+ # include the equation-number, using a
+ local($halign) = " ALIGN=\"CENTER\"" unless $FLUSH_EQN;
+@@ -1620,7 +1610,7 @@ sub do_env_eqnarray {
+ # if (s/\\lefteqn$OP(\d+)$CP(.*)$OP\1$CP/ $2 /) {
+ if (s/\\lefteqn//) {
+ $return .= "\"LEFT\" COLSPAN=\"3\">";
+- $* =1; s/(^\s*|$html_specials{'&'}|\s*$)//g; $*=0;
++ s/(^\s*|$html_specials{'&'}|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $_ = (($_)? &process_math_in_latex(
+ "indisplay" , '', '', $doimage.$_ ):'');
+@@ -1645,7 +1635,7 @@ sub do_env_eqnarray {
+
+ # left column, set using \displaystyle
+ $thismath = shift(@cols); $failed = 0;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $thismath = (($thismath ne '')? &process_math_in_latex(
+ "indisplay" , '', '', $doimage.$thismath ):'');
+@@ -1665,7 +1655,7 @@ sub do_env_eqnarray {
+
+ # center column, set using \textstyle
+ $thismath = shift(@cols); $failed = 0;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $thismath = (($thismath ne '')? &process_math_in_latex(
+ "indisplay" , 'text', '', $doimage.$thismath ):'');
+@@ -1685,7 +1675,7 @@ sub do_env_eqnarray {
+
+ # right column, set using \displaystyle
+ $thismath = shift(@cols); $failed = 0;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
+ $thismath = (($thismath ne '')? &process_math_in_latex(
+ "indisplay" , '', '', $doimage.$thismath ):'');
+Index: latex2html-2008/IndicTeX-HTML/itrans.perl
+===================================================================
+--- latex2html-2008.orig/IndicTeX-HTML/itrans.perl
++++ latex2html-2008/IndicTeX-HTML/itrans.perl
+@@ -406,13 +406,13 @@ sub do_env_pre_itrans {
+ } else {
+ if ($this_par =~ /^\\/) {
+ #catch 'paragraphs' that are just TeX macros
+- local($savedRS) = $/; $/ = ''; $* = 1;
+- if ($this_par =~ /^(\s*\\\w+)+$/s ) {
++ local($savedRS) = $/; $/ = '';
++ if ($this_par =~ /^(\s*\\\w+)+$/sm ) {
+ # save them for the next paragraph
+ $saved_par .= $this_par."\n\n";
+- $/ = $savedRS; $* = 0; next;
++ $/ = $savedRS; next;
+ }
+- $/ = $savedRS; $* = 0;
++ $/ = $savedRS;
+ }
+ if ($saved_par) {
+ #include any saved macros
+Index: latex2html-2008/styles/html.perl
+===================================================================
+--- latex2html-2008.orig/styles/html.perl
++++ latex2html-2008/styles/html.perl
+@@ -236,7 +236,7 @@ sub do_cmd_htmladdnormallink{
+ $url = &missing_braces unless
+ ((s/$next_pair_pr_rx/$url = $2; ''/eo)
+ ||(s/$next_pair_rx/$url = $2; ''/eo));
+- $*=1; s/^\s+/\n/; $*=0;
++ s/^\s+/\n/m;
+ if ($name) { $href = &make_named_href($name,$url,$text) }
+ else { $href = &make_href($url,$text) }
+ print "\nHREF:$href" if ($VERBOSITY > 3);
+Index: latex2html-2008/styles/more_amsmath.perl
+===================================================================
+--- latex2html-2008.orig/styles/more_amsmath.perl
++++ latex2html-2008/styles/more_amsmath.perl
+@@ -94,7 +94,6 @@ sub get_eqn_number {
+ , $EQNO_END);
+ }
+ } else { $tag = ';SPMnbsp;;SPMnbsp;;SPMnbsp;' }
+- $*=0;
+ if ($labels) {
+ $labels =~ s/$anchor_mark/$tag/o;
+ ($labels , $scan);
+@@ -285,7 +284,7 @@ sub process_env_equation {
+ } else { $return .= join('', $mspace , $ecell, $erow); }
+ } else {
+ $thismath = $_;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($doimage)||($failed)) {
+ $thismath = &process_math_in_latex("indisplay",'',''
+ , $doimage.$thismath ) unless ($thismath eq '' );
+@@ -430,7 +429,7 @@ sub process_env_multline {
+
+ # columns to be set using \displaystyle
+ $thismath = $_;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($doimage)||($failed)) {
+ $thismath = &process_math_in_latex("indisplay",'',''
+ , $doimage.$thismath ) unless ($thismath eq '' );
+@@ -767,7 +766,7 @@ sub process_env_align{
+ # alternating right/left aligned
+ $scell = (($scell eq $slcell)? $srcell : $slcell) if ($col_cnt);
+ $thismath = $_; $col_cnt++;
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($doimage)||($failed)) {
+ $thismath = &process_math_in_latex("indisplay",'',''
+ , $doimage.$thismath ) unless ($thismath eq '' );
+@@ -923,7 +922,7 @@ sub do_env_split {
+ @cols = split(/$mdlim/o);
+ # left column, set using \displaystyle
+ $thismath = shift(@cols);
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($doimage)||($failed)) {
+ $thismath = &process_math_in_latex("indisplay",'',''
+ , $doimage.$thismath ) unless ($thismath eq '' );
+@@ -940,7 +939,7 @@ sub do_env_split {
+
+ # right column, set using \displaystyle
+ $thismath = shift(@cols);
+- $* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
++ $thismath =~ s/(^\s*|\s*$)//gm;
+ if (($doimage)||($failed)) {
+ $thismath = &process_math_in_latex("indisplay",'',''
+ , $doimage.$thismath ) unless ($thismath eq '' );
+Index: latex2html-2008/styles/changebar.perl
+===================================================================
+--- latex2html-2008.orig/styles/changebar.perl
++++ latex2html-2008/styles/changebar.perl
+@@ -126,11 +126,11 @@ sub do_env_changebar {
+ $_ = &translate_environments($_);
+
+ # multiple ends of change-bars have icons on the same line.
+- $* = 1; local($saveRS) = $/; undef $/;
++ local($saveRS) = $/; undef $/;
+ s/(($endstr[^<]*<\/$cbstyle>)\s* (<<\d+>>($cbversion_rx)?)?\s*$)/
+- if ($`) {$1} else { $endcb = 0; $2.$3 }/eg;
+- s/($cbend_rx\s*$)/ if ($`) { $1 } else { $endcb = 0; $2.$4 }/eg;
+- $* = 0; $/ = $saveRS;
++ if ($`) {$1} else { $endcb = 0; $2.$3 }/egm;
++ s/($cbend_rx\s*$)/ if ($`) { $1 } else { $endcb = 0; $2.$4 }/egm;
++ $/ = $saveRS;
+
+
+ if ($this_version) {
+Index: latex2html-2008/styles/alltt.perl
+===================================================================
+--- latex2html-2008.orig/styles/alltt.perl
++++ latex2html-2008/styles/alltt.perl
+@@ -50,15 +50,15 @@ sub preprocess_alltt {
+ local ($before, $after, $alltt, $alltt_env);
+ local ($alltt_begin) = "";
+ local ($alltt_end) = "";
+- local($saveRS) = $/; $*=1;undef $/;
++ local($saveRS) = $/; undef $/;
+ while (/\\begin\s*{($alltt_rx)}([ \t]*\n)?/m) {
+ $alltt_env = $1;
+ $alltt = "";
+ ($before, $after) = ($`, $');
+- if ($after =~ /\\end\s*{($alltt_rx)}/s) {
++ if ($after =~ /\\end\s*{($alltt_rx)}/sm) {
+ ($alltt, $after) = ($`, $');
+ local(@check) = split("\n",$before);
+- local($lastline) = pop @check unless ($before =~ s/\n$//s);
++ local($lastline) = pop @check unless ($before =~ s/\n$//sm);
+ $alltt = &alltt_helper($alltt) # shield special chars
+ unless ($lastline =~ /(^|[^\\])(\\\\)*%.*$/m); # unless commented out
+ undef @check; undef $lastline;
+@@ -67,8 +67,8 @@ sub preprocess_alltt {
+ , $alltt, $alltt_end, "{$alltt_env}", $after);
+ }
+ $/ = $saveRS;
+- s/$alltt_begin\{([^\}]*)\}/\\begin{$1}/gos;
+- s/$alltt_end\{([^\}]*)\}/\\end{$1}/gos;
++ s/$alltt_begin\{([^\}]*)\}/\\begin{$1}/gosm;
++ s/$alltt_end\{([^\}]*)\}/\\end{$1}/gosm;
+ }
+
+ sub alltt_helper {
+Index: latex2html-2008/styles/amstex.perl
+===================================================================
+--- latex2html-2008.orig/styles/amstex.perl
++++ latex2html-2008/styles/amstex.perl
+@@ -404,7 +404,6 @@ sub get_eqn_number {
+ , $EQNO_END);
+ }
+ } else { $tag = ';SPMnbsp;' }
+- $*=0;
+ if ($labels) {
+ $labels =~ s/$anchor_mark/$tag/o;
+ ($labels , $scan);
+Index: latex2html-2008/styles/makeidx.perl
+===================================================================
+--- latex2html-2008.orig/styles/makeidx.perl
++++ latex2html-2008/styles/makeidx.perl
+@@ -189,7 +189,7 @@ sub named_index_entry {
+ # ! -> \001
+ # @ -> \002
+ # | -> \003
+- $* = 1; $str =~ s/\n\s*/ /g; $* = 0; # remove any newlines
++ $str =~ s/\n\s*/ /gm; # remove any newlines
+ # protect \001 occurring with images
+ $str =~ s/\001/\016/g;
+
+Index: latex2html-2008/styles/webtex.perl
+===================================================================
+--- latex2html-2008.orig/styles/webtex.perl
++++ latex2html-2008/styles/webtex.perl
+@@ -121,29 +121,29 @@ sub convert_to_webtex {
+ if($WEBEQ_IMG_ONLY) { return (1,$no_applet) };
+
+ local($savedRS, $failed, $env_id, $_) = ($/,'','',$orig);
+- $/=''; $* = 1;
++ $/='';
+ if ($mode =~ /inline/) {
+ if (/^\s*\\\(/) { $failed = 1 }
+ else {
+ $_ = &revert_to_raw_tex($_);
+- $_ =~ s/^\s*\$?/\$/s;
+- $_ =~ s/\$?$/\$/s;
++ $_ =~ s/^\s*\$?/\$/sm;
++ $_ =~ s/\$?$/\$/sm;
+ $env_id .= $WEBEQ_INL if $USING_STYLES;
+ }
+ } elsif ($mode =~ /display/) {
+ if (/^\s*\$\$/) { $failed = 1 }
+ else {
+ $_ = &revert_to_raw_tex($_);
+- $_ =~ s/^\s*(\\\[|\$\$)?/\\\[/s;
+- $_ =~ s/(\$\$|\\\])?\s*$/\\\]/s;
++ $_ =~ s/^\s*(\\\[|\$\$)?/\\\[/sm;
++ $_ =~ s/(\$\$|\\\])?\s*$/\\\]/sm;
+ $env_id .= $WEBEQ_DIS if $USING_STYLES;
+ }
+ } else {
+ print " *** Unknown WebTeX mode, no applet ***";
+- $/ = $savedRS; $* = 0;
++ $/ = $savedRS;
+ return (0,$no_applet)
+ }
+- $/ = $savedRS; $* = 0;
++ $/ = $savedRS;
+ return (0,$no_applet) if $failed;
+
+ ($failed,$_) = &check_only_webtex($_);
+@@ -325,7 +325,7 @@ sub cleanup_mml_attribs {
+ local($mml_code) = join('',);
+ close MML;
+
+- local($savedRS) = $/; $*=0; $/='';
++ local($savedRS) = $/; $/='';
+ $mml_code =~ s/^\s*\n?//s;
+ $mml_code =~ s/\s* | | | |