...the text I am concerned with is in an array (@ThisFileArray)...A for loop is usually better for looping over an array.
...with paragraphs separated by an extra newline....Perl can do that for you if you set $/ (see How can I read in a file by paragraphs?).
#!/usr/bin/perl use strict; use warnings; { local $/ = q{}; my @txt = <DATA>; for (@txt) { chomp; print qq{*$_*\n}; } } __DATA__ Text blah blah, make my point here. More text and even more continuing + on along the way. New paragraph starts here, there were 2 newlines just before I started + this paragraph, so I should somehow be able to match on that, but I can't figure out how to search for that throug +h my array.
Note that the extra pair of braces and local restricts the scope of the change to $/ (which is a global).*Text blah blah, make my point here. More text and even more continuin +g on along the way.* *New paragraph starts here, there were 2 newlines just before I starte +d this paragraph, so I should somehow be able to match on that, but I can't figure out how to search for that throug +h my array.*
I've added stars instead of tags. I would seriously consider using something like HTML::Element's new method to deal with creating HTML tags. YMMV.
In reply to Re: question on multi line pattern matching for html formatting
by wfsp
in thread question on multi line pattern matching for html formatting
by tallCoolOne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |