"AAC\nGTT\n" ^ $$^ $$ #### $ perl -wle 'print $& while "AAC\nGTT"=~/^.*$/mg;' AAC GTT #### $ perl -wle '"AAC\nGTT"=~/.*^(.*)$/ms; print $1' GTT