equal
deleted
inserted
replaced
66 if ($& == ":") { |
66 if ($& == ":") { |
67 $thyheader .= " "; |
67 $thyheader .= " "; |
68 } |
68 } |
69 $thyheader .= "begin"; |
69 $thyheader .= "begin"; |
70 # do replacement here |
70 # do replacement here |
71 print "$file:\n$thyheader\n\n"; |
71 if ($diag) { |
|
72 print "$file:\n$thyheader\n\n"; |
|
73 } else { |
|
74 open(OSTREAM, ">$file") or die("error opening $file"); |
|
75 print OSTREAM "$prelude$thyheader$postlude"; |
|
76 close(OSTREAM); |
|
77 } |
72 } |
78 } |
73 } |
79 } |
74 } |
80 } |
75 } |
81 } |
76 ); |
82 ); |
112 sub process { |
118 sub process { |
113 my ($file, $migrator, $backupext) = @_; |
119 my ($file, $migrator, $backupext) = @_; |
114 my ($basename, $dirname, $ext) = fileparse($file, @suffices); |
120 my ($basename, $dirname, $ext) = fileparse($file, @suffices); |
115 #~ print "$file\n"; |
121 #~ print "$file\n"; |
116 if ($ext) { |
122 if ($ext) { |
117 open ISTREAM, $file or die("error opening $file"); |
123 open(ISTREAM, $file) or die("error opening $file"); |
118 my @content = <ISTREAM>; |
124 my @content = <ISTREAM>; |
119 close ISTREAM; |
125 close ISTREAM; |
120 if ($backupext) { |
126 if ($backupext) { |
121 copy($file, "$file$backupext"); |
127 copy($file, "$file$backupext"); |
122 } |
128 } |