in reply to Why are this pattern match failing ?

Blush #1: Insufficient information (for /me anyway).

Blush #2: But did you (maybe) mean this?

if($d[0] =~ /NA/) {

...or this?

if($d[0] eq 'NA') {