in reply to Seemingly odd issue with push in foreach loops?
btw you can replace your foreach loop with grep:
@test3 = grep { /md/ } @test; [download]
or if you like to be verbose
@test3 = grep {$_ =~ /md/ } @test; [download]