s_ischr#

True if a stat-mode value names a character-special device.

Synopsis#

my $mode = (stat "/dev/tty")[2];
print "char device\n" if S_ISCHR($mode);

Returns 1 when $mode & S_IFMT == S_IFCHR, 0 otherwise. With no argument, returns 0.