my $vsftplog = "vsftplog"; open(VLOG, $vsftplog) || die "Cannot open log file: $!\n"; while () { my @fields = split(/ /); if (( "$fields[-7]" eq "i" ) && ( $fields[9] =~ m/(\/fileA-*?.?)|(\/fileB-*?.?)|(\fileC-*?.?)|(\/fileD-*?.?)/ )) { print "@fields"; } }