perl -le '$s = "this is a string"; print +(split(/\s/, $s))[-1];'