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

Replies are listed 'Best First'.
Re^2: if fooled by pesky leading white space
by partymeeple (Novice) on Jul 14, 2008 at 04:17 UTC
    YAY!!

    that's what i was looking for.. i knew it must be possible but i've not got my head around regular expressions yet..

    thank you both for your help

    -- bows low--

    beware the farmers.

      Some of the resources I list here may be of help to you.

      HTH,

      planetscape