$type = $1 if $results[3] =~ /(\.\w+)$/; # thanks, Ovid