Hello
I havent used perl for a long time and am trying to refresh my memory to write a quick script - i have got the general jist of whatim doing but am still having a slight problems.
I am trying to open up a file of usernames for reading and then trying to find if the username is presnt within a SAM file (password file) - if it is then print the corresponding line in the password file. The script seems to work for the first found username but no others - if anyone has any ideas it would be appreciated
open (MYFILE, "test.txt"); //usernames file
open (MYFILE1, "test1.txt");
while ($record = <MYFILE>) {
chomp($record);
while ($record1 = <MYFILE1>) {
chomp($record1);
if ($record1=~m/$record/){print "$record1 \n";}
}
close(MYFILE1);
}
close(MYFILE);
I havent used perl for a long time and am trying to refresh my memory to write a quick script - i have got the general jist of whatim doing but am still having a slight problems.
I am trying to open up a file of usernames for reading and then trying to find if the username is presnt within a SAM file (password file) - if it is then print the corresponding line in the password file. The script seems to work for the first found username but no others - if anyone has any ideas it would be appreciated
open (MYFILE, "test.txt"); //usernames file
open (MYFILE1, "test1.txt");
while ($record = <MYFILE>) {
chomp($record);
while ($record1 = <MYFILE1>) {
chomp($record1);
if ($record1=~m/$record/){print "$record1 \n";}
}
close(MYFILE1);
}
close(MYFILE);