in reply to Checking for occurrence in comma separated string
Thanks for all your comments. The result of changing the if ($thecheck =~ /$thestring/) to if ($thestring =~ /$thecheck/), got the check working, however returned the false positives, as thought it would.
Using the followup from bart at 11:28, I got it working as desired.
As far as taking into account numbers verses words, spaces and even commas and decimal points in the variable, the two variable string are created from database information. They *should* always be numbers, but may not. Any spaces are removed when the information is added to the variable/database, and the commas are added when the actual data is written to the database. So all in all, a check string of 13 against the datastring of say 13,130,213 are very real possibilities, and each one would be written exactly as shown (no spaces, unwanted commas etc), and then read out at a later time for processing.
The actual content (the different numbers, letters, or words) is irrialavent (have no (human) meaning), however, the numbers (in the case) are id links to other database enteries, thus I compair the information against the databases (data linking). So no information is user entered, rather generated by Perl and/or, in the case, MySQL.
Based on that, I'm sure someone will say the usage of bart's method if(index(",$thestring,", ",$thecheck,") >= 0) { ... } shouldn't be used, rather I should use something else. However, I tested the array method verses the index method, and I prefer the index method. It does exactly as desired. Perhaps there is a short comming one should be aware of here, considering how I'm actually using it? For example memory limitations.... In any event the two variables will not exceed 10 and 100 chars (including commas) for the respective variable.