in reply to Re: Match a chunk
in thread Match a chunk

Let me try to express the problem better, i did indeed confuse by including too much. Being less confused myself this morning, i have eliminated all except what i really need in the following and resolved it:
#!/usr/bin/perl -w use strict; my @updateloc1 = ("LakeOsouth/stuf", "LakeOeast/stuf", "LakeO2/stuf", +"LakeO/stuf"); my @texlines = ("LakeOsouth", "LakeOeast", "LakeO2", "LakeO"); for my $lin (@texlines){ for my $update (@updateloc1){ if ($update =~ /$lin/){ print "The table column $lin matches the directory name $u +pdate, so now do stuf in the subdir\n"; } } }
The above code works, except that when it gets to table column $lin = LakeO it matches all the members in updateloc1, so my struggle has been to make $lin match $update exactly to the forward slash. Well, after re-arranging the loops, the solution is simple: $update =~ /$lin\//. Should have taken a break much sooner.