in reply to Re: Why am I get a core dump when I use ??{}
in thread Why am I get a core dump when I use ??{}
... use strict; my $countSpaces = sub { my $spaces = tr/ //; return qr{(?!)} if $spaces > 1; return qr{(?=)}; }; while (<DATA>) { chomp; print "$_ [", /(.*)(??{$countSpaces->()})/ ? "OK]\n" : "BAD]\n +"; } __DATA__ this line has more than one space that_is_5_spaces This isonespaceonly therearenospaceshere
| Plankton: 1% Evil, 99% Hot Gas. |
|
|---|