All pastes #31168 Raw Edit

Anonymous

public text v1 · immutable
#31168 ·published 2005-11-25 14:06 UTC
rendered paste body
#!/usr/bin/perl -w

$teststring = "Leeman.-";
print $teststring;
print "\n";

$teststring = check($teststring);
print $teststring;
print "\n";


sub check ($string) {

if ($string !~ /^[-.\w]+$/) { #words.. aka a-zA-Z_ and also - and .
#        print "unauthorized char"; #unauthorized char
return "unauthorized char";
} else {
#        print "passed"; #passed
return "passed";
}

}