#!perl use warnings; use strict; my %attr; %attr = split(/\s*[,=]\s*/,'corpid=xxxxxx,ou=people,o=corp'); if exists $attr{ou} { print "value for ou is $attr{ou}\n"; } else { print "No value defined for ou...this may be an error\n"; }