new task in perl (which I have never used before). So please help me though it sounds silly.
A variable named RestrictedNames contains a list of restricted user names. SplitNames is an array variable that contains the full set of username. Now I need to check if the current name is found in the RestrictedNames variable, for example using instr.
@SplitNames = ("naag algates", "arvind singh", "abhay avasti", "luv singh", "new algates"), and now I want to block all surnames that have "singh", "algates", etc.
@SplitNames = ("naag algates","arvind singh","abhay avasti","luv singh","new algates")
$RestrictedNames="tiwary singh algates n2 n3 n4 n5 n6";
for(my $i=0;$i<@SplitNames;$i++)
{
if($RestrictedNames =~ m/^$SplitNames[$i]/ )
{
print "$SplitNames[$i] is a restricted person";
}
}
I ask you to help me in solving the problem. If this is already set, forgive me and share this link.