in reply to Re: get a text out from a string
in thread get a text out from a string
You can do something like this:
But that only hides the conditional in the ternary operator. And you can use parenthesis in the regex and access the matched value with $1, but you still need a conditional somewhere to check its value.$productcode = $productcode =~ m/^FCL/ ? : 'FCL' : "No, sorry";
|
|---|