Reputation: 662
I want to do something like this
if($variable =~ /$other_variable_expression/){
do something;
}
where $other_variable
is a dynamic part(changed by a loop etc.) and expression
is a static part like "abc" always!
How to do?
Upvotes: 1
Views: 40
Reputation: 98398
Two ways:
/${other_variable}_expression/
or
/$other_variable\_expression/
Upvotes: 5