my $directory = '/home/psimo/it441/challenge/logs'; ... my $theFile = ...; ... my $path_file = "$directory/$theFile"; open my $fh, '<', $path_file or die "opening '$path_file': $!"; ...