Putting a "zero or more characters from this class" regular expression into split (as in split /\n\r\l*/) effectively splits a string into individual characters - the regex is true between every single character. Your code would get further if you tried split /\n\r\l+/ ....
Using regular expression matches, you could do something like:
#!/usr/bin/perl use strict; use warnings; undef $/; # read whole file at once our $cert = <>; our ($info) = $cert =~ m/X509v3 Basic Constraints:\s+([^\n]+)/; print "Constraints = $info\n";
In reply to Re: Split on a new line
by odrm
in thread Split on a new line
by Luken8r
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |