in reply to Why am I get a core dump when I use ??{}

My first guess is abuse of $1.

Why not just call tr/// to count characters?

while (<DATA>) { print qq("$_" ), tr/ // <= 1 ? "has 1 or no spaces\n" : "has more than one space\n"; }

After Compline,
Zaxo