I'm fairly new to perl and had a question. Is there an easy way to do something like this without using a whole lot of if statements:
Code:
my $s = "=~"; # could also possibly be "!~", "<=", etc etc
my $b = "^"; # could also be "", "$", etc etc
my $t = "blah"
my $phrase = "blah bleh bluh";
if ($phrase $s /$b $t $b/) { # equates to "if $phrase =~ /^blah/"
# this block should run since the statement is true
}