my (@tmp, @titles); while () { if ( my @tmp = m/\_[\d\](.+)_/g ) { push @titles, @tmp; } }