×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Easy Scalar Matching Problem

## Easy Scalar Matching Problem

(OP)
But not easy to me.  What do I need to do to match all of the occurrences of a name of a month?  This is what I've got, but it doesn't work this way, using qw, whitespace instead of ¦, or as an array.  I don't get it.
***************************
$months='january¦february¦march¦april¦may¦june¦july¦august¦september¦october¦november¦december'; if ($token =~ /$months/) { print "Matched"; } I notice that the pipes change back to HEX 'A6' when this POST is previewed. keep the rudder amid ship and beware the odd typo ### RE: Easy Scalar Matching Problem (OP) GoBoat: Thanks much yr reply. It still doesn't work on my Windows machine. What is the English description of HEX7C? I tried the same code using commas and whitespace, with same unsuccessful result. And, is there another way to do this? It does seem strange, doesn't it? rja ### RE: Easy Scalar Matching Problem I am having some real trouble believing that the pipe char could be the problem here.....we must be missing something. Maybe someone else has some ideas.... Anyway, in english... HEX 'A6' is a broken vertical bar. - Decimal value '166' HEX '7C' is a solid vertical bar. - Decimal value '124' When I use "shift-\"(below backspace and above enter - on my keyboards), I get a pipe symbol (verticle bar) with a hex value of '7C'. That character works as the 'OR' operator. This is true for the WinNT 4.0 box and for my Sun Ultra running SunOS. keep the rudder amid ship and beware the odd typo ### RE: Easy Scalar Matching Problem I have perlbuilder and running win nt. I just tried out the code and it works. Here is what my code is:$months='january¦february¦march¦april¦may¦june¦july¦august¦september¦october¦november¦december';

$token = 'march'; if ($token =~/\$months/) {print "yes";}

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!