... 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. |
In reply to Re: Re: Why am I get a core dump when I use ??{}
by Plankton
in thread Why am I get a core dump when I use ??{}
by Plankton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |