sub get_file_from_log(){ my $log_name=shift; open(my $log_file, "<", $log_name);
Your prototype says to accept NO arguments but your next line says to accept ONE argument. You should not use prototypes!
You should always verify that open worked correctly before trying to use a possibly invalid filehandle.
open(my $log_file, "<", $log_name); my $file_name; while (<logFile>){
You are opening the filehandle $log_file but you are trying to read from the filehandle logFile?
In reply to Re^2: Need to search for a string in a file
by jwkrahn
in thread Need to search for a string in a file
by akrrs7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |