in reply to pattern match

Look for word boundaries.

$line = $. if (m/\b$complex\b/);
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg