use three-arg open(), not two-arg
use strict
change foreach to map
Issue #50: illusion of use of $1 after failed match