if (`cat /vmunix` =~ /gzip/) { print "Your kernel is GNU-zip enabled!\n"; }
On some systems, however, you have to play tedious games with ``text'' versus ``binary'' files. See binmode.
If you're concerned about 8-bit ASCII data, then see the perllocale manpage.
If you want to deal with multi-byte characters, however, there are some gotchas. See the section on Regular Expressions.