$NetBSD: patch-perllib_sdf_tomif.pl,v 1.1 2019/09/10 21:20:35 schmonz Exp $

Use /m instead of $*, no longer available in Perl 5.30.
Patch from Debian: 005_multiline.diff

--- perllib/sdf/tomif.pl.orig	1998-10-23 22:59:43.000000000 +0000
+++ perllib/sdf/tomif.pl
@@ -660,16 +660,12 @@ sub _MifAddSection {
 sub _MifEscape {
     local(*text, $escape_space) = @_;
 #   local();
-    local($orig_linematch_flag);
 
-    $orig_linematch_flag = $*;
-    $* = 1;
     $text =~ s/([\\>])/\\$1/g;
     $text =~ s/\t/\\t/g;
     $text =~ s/'/\\q/g;
     $text =~ s/`/\\Q/g;
     $text =~ s/ /\\ /g if $escape_space;
-    $* = $orig_linematch_flag;
 }
 
 #
@@ -1984,7 +1980,7 @@ sub _MifFinalise {
     local(@out_result);
     local($pwidth, $pheight);
     local($component_prefix);
-    local(%offset, $old_match_rule);
+    local(%offset);
     local(%merged_ctrls, %merged_vars, %merged_xrefs);
     local(%merged_paras, %merged_fonts, %merged_tbls);
     local($mainflow);
@@ -2099,12 +2095,9 @@ $igc_start = time;
         "<Notes ",
         "> # end of Notes",
         @text);
-    $old_match_rule = $*;
-    $* = 1;
     $mainflow =~ s/\<ParaLine/$&\n  <TextRectID $_MIF_TEXTFLOW_MAIN>/;
     $mainflow =~ s/\n/\n /g;
     $mainflow .= "\n> # end of TextFlow";
-    $* = $old_match_rule;
 
     # Add the text flows to the  import table
     push(@out_result, join("\n", @_mif_textflows, $mainflow));
@@ -2315,7 +2308,7 @@ sub _MifAddTextFlow {
     local(*text, $tag, $mif) = @_;
     local($id);
     local(@hdr, @flow);
-    local($textflow, $old_match_rule);
+    local($textflow);
 
     # Get the next text flow id
     $id = $_mif_textflow_cnt++;
@@ -2340,12 +2333,9 @@ sub _MifAddTextFlow {
     # Convert to a text flow
     if (@flow) {
         $textflow = join("\n", @flow);
-        $old_match_rule = $*;
-        $* = 1;
         $textflow =~ s/\<ParaLine/$&\n  <TextRectID $id>/;
         $textflow =~ s/\n/\n /g;
         $textflow .= "\n> # end of TextFlow";
-        $* = $old_match_rule;
     }
 
     # If nothing was generated, build the text flow with a dummy paragraph
@@ -2805,7 +2795,7 @@ sub _MifAddLists {
     local(%attr);
     local($layout);
     local($i);
-    local($old_match_rule, $toc_offset);
+    local($toc_offset);
 
     # Set some flags based on the output ultimately generated
     $target = $SDF_USER'var{'OPT_TARGET'};
@@ -2833,8 +2823,6 @@ sub _MifAddLists {
     # Insert the generated lists before the first level 1 heading
     push(@_mif_toc_list, @_mif_lof_list, @_mif_lot_list);
     if (@_mif_toc_list) {
-        $old_match_rule = $*;
-        $* = 1;
         $toc_offset = 0;
         para:
         for ($i = 0; $i <= $#text; $i++) {
@@ -2843,7 +2831,6 @@ sub _MifAddLists {
                 last para;
             }
         }
-        $* = $old_match_rule;
         splice(@text, $toc_offset, 0, @_mif_toc_list);
     }
 }
@@ -2901,15 +2888,9 @@ sub _MifMerge {
     local(*template, *import, %offset) = @_;
     local(@new);
     local($record, $obj);
-    local($old_match_rule);
     local($merged_pages, $merged_textflows, %ref_textflow);
     local($side_width);
     local($page_type, $page_name, $page_size, $cover_rect);
-    
-    # To permit multi-line matching, save the old state here and
-    # restore it later      
-    $old_match_rule = $*;
-    $* = 1;
 
     #
     # Do the merge. We ignore BookComponent objects
@@ -2926,14 +2907,14 @@ sub _MifMerge {
     while($record = shift(@template)) {
     
         # Find the object 'name'
-        unless ($record =~ /^\<(\w+)/) {
+        unless ($record =~ /^\<(\w+)/m) {
             &AppExit("fatal", "MIF template error - expecting object");
         }       
         $obj = $1;
 
         # Patch the comment to claim responsibility
         if ($obj eq 'MIFFile') {
-            $record =~ s/\>.*$/>/;
+            $record =~ s/\>.*$/>/m;
             $record .= " # Generated by $app_product_name $app_product_version";
         }
         
@@ -2993,7 +2974,6 @@ sub _MifMerge {
     }
     
     # Return result
-    $* = $old_match_rule;
     return @new;    
 }
 
