in reply to split...or better?
Upd: or just
perl -le 'print "foo.bar.aaa" =~ /([^.]*)\./;' [download]