use strict; use warnings; use Test::More; for my $word (split (/ /, "I fear that I'll be extinct after a few million years.")) { like $word, qr/^\w*$/, "Match $word with \\w"; like $word, qr/^\S*$/, "Match $word with \\S"; } done_testing ();