while() { /(.*\.)?(\S+)/; print "$2\n"; } __DATA__ 2L bar.2L bar.ber.bir. 2L bar.ber.bir.2L