in reply to perl can find the file but can not open the file

Hi,

I'm not sure whether your problem is solved, the right hint was given by choroba. With the code line

open ( FH0, '<./$file' ) or die "Unable to open $file: $!\n";
you try to open a file with the name './$file' and not with the filename './linux_complete_command_set.txt' as you like. The single quotes suppress variable expansion.

Another reason to use the three parameters form of open

open (FH0, '<', $file) or die ...

Best regards
McA