in reply to Re^2: extraction of text between 2 similar patterns in a text file
in thread extraction of text between 2 similar patterns in a text file
Since you don't use indentation, it makes your code difficult to read. So the first thing I'd suggest is reformatting it so you can more easily see the structure. I'd next suggest using "use strict;" and "use warnings;" to help find possible problems (such as closing file handles you don't actually have open).
Then I'd look at the bits you don't understand, and figure out what they mean. For example, what do you want the if statement on line 29 (if(/(\d\_)+a1/.../(\d\_)+a1/)) to do?. Since it governs when you actually emit files, it would be a good place to start.
Finally, you may want to read about the perl debugger, as executing code under the debugger can be very helpful to both fixing your program as well as understanding how the code operates.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: extraction of text between 2 similar patterns in a text file
by Anonymous Monk on May 17, 2011 at 15:37 UTC | |
by roboticus (Chancellor) on May 17, 2011 at 21:38 UTC |