hello everyone. i am new to perl programming. so i wanted to ask you that after splitting up a string into an array of characters how do i check induvidually each character if it matches a set of characters........... for eg original string ------>FLLICEK i want to check each character if it is either T,D,L or F and if it is increment counter by 1 F------> it is one of the characters T,D,L,F so increment counter to 1 L-------> it is one of the characters T,D,L,F so increment counter to 1 L-------->(2nd L) it is one of the characters T,D,L,F so increment counter to 1 but i am not getting the method to do it . plz help me......
i tried to do it using the || operator Code: if($x=='T'||$x=='D'||$x=='L'||$x=='F'){ $count+=1; } but it increments the counter for every character.
maybe a debugoutput in the if that display $x's value helps you more... the if statements looks good...