in reply to splitting punctuation in a text

#!/usr/bin/perl use strict; use warnings; my $s = 'earth, wind & fire'; my @out = split /\b/, $s; print "$_\n" foreach (@out);
and if you just needed the words without the punctuation marks:
foreach (@out) { print "$_\n" if ($_ =~ /\w/); }