Hello perl programmers. i have the following code in one of my scripts.
i dont have any idea about what does most of the code do. i will put some notes regarding which parts i dont undrestand. could anybody please explain in details ???
almost 3 parts of this code which are the most important parts are not undrestood. thnx in advance
i dont have any idea about what does most of the code do. i will put some notes regarding which parts i dont undrestand. could anybody please explain in details ???
almost 3 parts of this code which are the most important parts are not undrestood. thnx in advance
Code:
@a=();
$advert=0;
open(che,"namess/list.txt");
while (<che>) {
@a=();
$advstr="";
###### what is being splite ?#####
@a = split(//,$_);
foreach $let (@a) {
if ($let eq "l" || $let eq "i" || $let eq "1") {
#### what does the following mean ? please in details specially [\\W_] #####
$advstr .= "*[il1|!]+[\\W_]";
#########################################
} elsif ($let eq "o" || $let eq "0") {
$advstr .= "*[o0]+[\\W_]";
} elsif ($let eq "a" || $let eq "@") {
$advstr .= "*[a@]+[\\W_]";
} else {
$advstr .= "\*$let\+[\\W_]";
}
}
######### im asking alot but these lines are not undrestood ####
$advstr =~ s/\+\[\\W\_\]\*\s+\+\[\\W\_\]$//ig;
$advstr =~ s/^\*//ig;
$advstr =~ s/\./\\\./ig;
$advstr =~ s/\@/\\\@/ig;
$advstr =~ s/\$/\\\$/ig;
$advstr =~ s/\-/\\\-/ig;
############################################
if ($IN{'msg'} =~ /$advstr/ig){
$advert++;
}
}
close(che);
Comment