C:\>perl -E "my $str1 = qq(|L|D|); my $str2 = qr(\|L\|);if ($str2 =~ $ +str1) { say 'foo';}" foo
Actually, SimonPratt is right. From OP's description ($str2 ["is in"] as a part of $str1) requires a regex test (if used) in the above order.
Update: Added direct quote from OP's spec to clarify my paraphase, "as a part of...."
In reply to Re^2: Stupid question about strings...
by ww
in thread Stupid question about strings...
by kepler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |