Dear Monks
I have a long text stored in a variable $text (the problem is, the text must remain in this simple variable). I search with a Regexp in this variable through a while loop
while ( $text =~ /$query/gi ) {
do_something();
}
What I'd like to do is to add another condition: **if $text =~ /$query_modified/gi {do_something_different();}**
Why: the sub do_something must process some information depending on the presence of $query_modified in the variable $text. As these conditions may vary across $text, I need to run the two conditions in a way different as the next one proposed which is not good for me as I need to process the two conditions at the same time.
while ( $text =~ /$query/gi ) {
do_something();
}
while ( $text =~ /$query_modified/gi ) {
do_something_different();
}
Is there a way to perform this?