perlperlperl has asked for the wisdom of the Perl Monks concerning the following question:
If I want to match the above record format, i.e. Name, Phone, Address (separated by NL), in a file with a whole bunch of these, what should I do? The way I do it right now is to read file into array, then use join operator on array to assign lines to a scalar, then use a multi line regex that scans for the record pattern of Name Phone Address using the multi line match modifier. I am successful at this. But is this the right way? I am concerned that using the join operator to assign thousands of lines to a scalar and then doing a multi line match for the pattern is not portable because not all implementations may be able to store thousands of lines in a scalar using join
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: proper way of matching multiple line patterns
by Eliya (Vicar) on Dec 30, 2011 at 03:50 UTC | |
by mbethke (Hermit) on Dec 30, 2011 at 05:47 UTC | |
|
Re: proper way of matching multiple line patterns
by moritz (Cardinal) on Dec 30, 2011 at 05:08 UTC | |
|
Re: proper way of matching multiple line patterns
by TJPride (Pilgrim) on Dec 30, 2011 at 06:41 UTC | |
|
Re: proper way of matching multiple line patterns
by Marshall (Canon) on Dec 30, 2011 at 13:20 UTC |