On 4/28/07, Jen mlists <[EMAIL PROTECTED]> wrote:
}elsif ($uri =~ m|www\.example\.com/v2/|o) {
$uri =~ s|www\.example\.com/v2/|v2.example.com/|;
The /o modifier isn't desirable there. Also, because a s/// will only
replace if the match part succeeds, you can skip the test:
$uri =~ s#www\.example\.com/v2/#v2.example.com/#;
If it matters to you whether the pattern matched or not, you may test
the result in a scalar context:
} elsif ($uri =~ s#www\.example\.com/v2/#v2.example.com/#) {
# substitution succeeded, do nothing further
} elsif (...) {
Hope this helps!
--Tom Phoenix
Stonehenge Perl Training
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/