if (/^(?[01]):(?[01]):(?[^:]+):(?[^:]+)$/) { print "Key name: ", $+{name}, "\n"; print "Key Comment: ", $+{comment}, "\n"; print "Not valid\n" unless $+{valid} || !$+{type}; } else { print "Malformed input: $_\n"; }