#!/usr/bin/perl
use strict;
use warnings;
my $a = my $b = my $c = join '', map(chr, 32 .. 126);
print "a = $a\n";
$a =~ s/\W//g;
$a =~ s/_//g;
$b =~ s/\W|_//g;
# allow letters, numbers, and dots
$c =~ s/[^a-z0-9.]//gi;
print "a = $a\n";
print "b = $b\n";
print "c = $c\n";
__END__
You should take a look at perlre when you get a chance. |