Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: if fooled by pesky leading white space

by GrandFather (Saint)
on Jul 14, 2008 at 03:50 UTC ( #697375=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://697375]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2022-12-05 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?