in reply to Testing for unprintable characters

use POSIX; for ("foo; is ok", "foo\x3") { if (/[^[:print:]]/) { print "Contains unprintables\n"; } else { print "$_ is safe\n"; } }
See POSIX isprint function.

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Testing for unprintable characters
by davorg (Chancellor) on Nov 15, 2005 at 16:47 UTC

    Despite the name, you don't need to use the POSIX module in order to use POSIX character classes.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg