my $productcode = "FCLA"; if ($productcode =~ m/(FCL)/){ print "$1\n"; } else { print "No FCL in product code!\n"; }
Or simply: $productcode = 'FCL' if $productcode =~ m/FCL/;
In reply to Re: get a text out from a string
by moritz
in thread get a text out from a string
by adrive
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |