The plain old C way:
#!perl
use strict;
use warnings;
sub contains_alpha($) {
my ($ord_a, $ord_z, $ord_A, $ord_Z) = map ord, qw/a z A Z/;
for (split //, $_[0]) {
$_ = ord $_;
return 1
if ($ord_a <= $_ and $_ <= $ord_z) || ($ord_A <= $_ and $_ <=
+ $ord_Z);
}
return 0;
}
for (<DATA>) {
chomp;
print "'$_' " . (contains_alpha $_ ? 'contains' : 'does not contain
+')
. " standard alphabet characters\n";
}
__DATA__
Hi
123456789o
1234567890
xAFCE3
xAFCEA
... --- ...
.s. -o- .s.
Not really creative, though...
CombatSquirrel.
Entropy is the tendency of everything going to hell.