biswanath_c has asked for the wisdom of the Perl Monks concerning the following question:
utf8::upgrade( my $alphanums = $chars ); $alphanums =~ s/[\W_]//g; [download]
( my $alphanums = $chars ) =~ s/\P{Alnum}//g; [download]
utf8::upgrade makes /\w/ match alphanums and "_", and /\W/ everything else.
Update: The original solution didn't remove underscores. Fixed. Update: Added alternative method.