On Sat, Dec 15, 2001 at 03:14:25PM -0500, Michael R. Wolf wrote:
> In C, there are a bunch of macros (is_visable, is_num,
> is_alpha, etc..). They were just some interesting bit mask
> magic to a table full of OR'd flags. Cute algorithm,
> actually. Since it used CPP, it didn't incur the overhead
> of a function call.
The concept is officially defined in one of the POSIX specifications (I
don't know which), and, as a result, functions for checking values can be
found in POSIX.pm. For example:
use POSIX qw(isprint);
for my $i (0 .. 255) {
print "$i is printable\n" if isprint(chr $i);
}
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]