open my $FH, '<', $file or die "Can't open $file: $!\n"; #### use Data::Dumper; my @arr; while () { chomp; push @arr, $1 if m{^ +\s+(//.*)}; } print Dumper \@arr; __DATA__ // humpty dumpty // sat on a wall -// eating her curds and whey // humpty dumpty // had a great fall #### $VAR1 = [ '// humpty dumpty', '// sat on a wall', '// humpty dumpty', '// had a great fall' ];