my @matches = grep /$filename/, keys %path_versions; #### perldoc -f grep #### my $last_string = ( split /\s+/, $depopath )[-1];