http://www.perlmonks.org?node_id=1018819


in reply to Re: Printing Last Element of a line using perl memory?
in thread Printing Last Element of a line using perl memory?

Might just be style but I'd make the trailing whitespace removal a bit more specific ("\W" to "\s"):

m/(\w+)\s*$/;