$var = ".declare book_num a13"; $var =~ s/^\.\w+\s+(\w+).*$/$1/g;