in reply to While two conditions

Do you mean something like this?

if( $text =~ /$query/i ) { while ( $text =~ /$query/gi ) { do_something(); } } elsif( $text =~ /$query_modified/i ) { while ( $text =~ /$query_modified/gi ) { do_something_different(); } } else { ## Is this possible? }

Or perhaps:

while ( $text =~ /($query|$query_modified)/gi ) { if( $1 eq $query ) { do_something(); } else { do_something_else(); } }

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^2: While two conditions
by GotToBTru (Prior) on May 01, 2012 at 14:24 UTC
    A good answer to what he asked .. but not what he wanted. XY problem, I think.