$str = "this is a string"; @str = split /\s/, $str; print pop(@str); #### print pop(split(/\s/, $str));