in reply to Split on a new line

Maybe using a X.509 certificate parser from CPAN, like Crypt::X509 would be easier to extract what data You want from the certificate.

:)))))