Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello- I am fairly new to Perl and have been working on this problem for a couple days now and am a little lost. I need to compare to see if a string in a list is not/or is a substring of an element of another list.
For example: list1[0] = '123' list2[0] = '333 444 555 666' list21 = '333 444 555 666 123' Returns should be list1[0] =~ list2[0] = false list1[0] =~ list21 = true and vice versa for !~ Using =~ and !~ m/$string/i has not been helpful. It has been returning false for anything. I have tried to split out the whitespace using split(/\s+/, $list2$i) but I get strange results. I just glanced over 2D arrays and thought that this might be an option. Any guidance would be aprreciated! Thanks! In reply to Substring comparison by schtinkfist893
|
|