in reply to Multiline Regex replacement in Multiline file
This would be a far better question -- i.e., one that would be easier for us to help you with -- had you included some explanation of what's going wrong -- error messages; erroneous output (that is, output other than what you expected and wanted); computer begins to smoke; etc.
My guess, however, is that perhaps you saw something like this (where <t>nn is perhaps 14, 15, or 16, depending on what your header (hashbang, strict, warnings, etc) contains.):
Use of uninitialized value within %dic in substitution iterator at 110 +0671.pl line nn, <F> line 3. Use of uninitialized value within %dic in substitution iterator at 110 +0671.pl line nn, <F> line 3.
If so, Perl is basicly telling you it ran out of input at line 3 of your input file... which makes a lot of sense since your sample shows only two lines in the input file.
An ordinary way to deal with this is to read from F in a WHILE construct; other would be to test the read result for content (ie, len != 0 or similar).
UPDATE: PS: put code tags around data, as well as around code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multiline Regex replacement in Multiline file
by akamboj84 (Novice) on Sep 16, 2014 at 01:30 UTC | |
by davido (Cardinal) on Sep 16, 2014 at 02:01 UTC |