Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use strict; my $newvar; my $var = "123, abc; don't use (these)"; my(@var) = split /\s+/, $var; foreach (@var) { s/\W//g; $newvar .= "$_ "; } print "VAR: $newvar"; #VAR: 123 abc dont use these
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I remove non-word chars but leave spaces intact?
by japhy (Canon) on Mar 13, 2001 at 03:48 UTC | |
|
Re: How do I remove non-word chars but leave spaces intact?
by bjelli (Pilgrim) on Mar 13, 2001 at 19:31 UTC |