sub search { if ( (-f) && /08\..*00$/ ) open the file while ( $line = ) { if ( $line =~ m/regex/ ) { @spt = split(/\:/, $line); push(@spt1,@spt[1]); foreach $spls (@spt1) { find(&wanted, $seek_path, $spls); sub wanted { print $spls; } } }