Plankton has asked for the wisdom of the Perl Monks concerning the following question:
$ cat dumps_core.pl #!/usr/bin/perl -w use strict; my $countSpaces = sub { my ($c) = ($1); my @spaces = ($c =~ /( )/g); return qr{(?!)} if $#spaces > 0; return qr{(?=)}; }; while (<DATA>) { #my @spaces = (/( )/g); print "$_ ", /(.*)(??{$countSpaces->()})/ ? "has 1 or no space +s\n" : "has more than one space\n"; } __DATA__ this line has more than one space that_is_5_spaces This isonespaceonly therearenospaceshere $ ./dumps_core.pl Segmentation fault (core dumped)
| Plankton: 1% Evil, 99% Hot Gas. |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why am I get a core dump when I use ??{}
by Zaxo (Archbishop) on Apr 09, 2004 at 21:09 UTC | |
|
Re: Why am I get a core dump when I use ??{}
by ambrus (Abbot) on Apr 09, 2004 at 21:12 UTC | |
by BazB (Priest) on Apr 09, 2004 at 21:16 UTC | |
by ysth (Canon) on Apr 09, 2004 at 21:19 UTC | |
|
Re: Why am I get a core dump when I use ??{}
by gmpassos (Priest) on Apr 09, 2004 at 22:48 UTC | |
by Plankton (Vicar) on Apr 10, 2004 at 04:17 UTC | |
|
Re: Why am I get a core dump when I use ??{}
by Anonymous Monk on Apr 09, 2004 at 21:09 UTC |