P is for Practical | |
PerlMonks |
Re: Re: Multiline Regexby InfiniteSilence (Curate) |
on Feb 16, 2001 at 01:18 UTC ( [id://58720]=note: print w/replies, xml ) | Need Help?? |
Although the right solution is to use multiline mode, your code doesn't do anything as the test on the regex reveals. See here:
The above code returns nothing, meaning that the regex never does the substitution. From a quick rereading of the algorithm, it looks like he is trying to do the following: 1. Read through the file 2. find lines that start with IP addresses 3. ASK if the next line following it has some specific text 4. write an extra space BETWEEN the IP address line and the specific text line I may be wrong, as the spec. was pretty poorly written. A quick command line example that does this is as follows:
Celebrate Intellectual Diversity
In Section
Seekers of Perl Wisdom
|
|