Four bugs.
Fix:
my ($earliest) = $str =~ /(\Q$first\E|\Q$second\E)/; print( "$earliest\n" ) if defined( $earliest );
Update: Added 4th bug.
In reply to Re^2: out of two strings which occurs first in a text
by ikegami
in thread out of two strings which occurs first in a text
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |