in reply to if fooled by pesky leading white space
Use a regex instead of eq to perform a more relaxed match:
if ( ($staff[$i * 3 + $staff_last] =~ /^\s*\Q$names[0]\E\s*$/) && ($staff[$i * 3 + $staff_first] =~ /^\s*\Q$names[1]\E\s*$/))
Perl is environmentally friendly - it saves trees
In Section
Seekers of Perl Wisdom