my $command = "certutil -L -d $config{firefox_profile}"; open(OUTPUT , "-|", "$command"); while (my $current = ){ chomp $current; if ($current =~ /^($certname)/i) { #Do something } }