in reply to Find what characters never appear

How about something like:

#!/usr/bin/perl use strict; use warnings; my %char_hash = (); $char_hash{ chr($_) } = 0 foreach (33 .. 127); while (<DATA>) { map $char_hash{$_}++, split //; } my @good_array = grep{ $char_hash{$_} == 0 } keys %char_hash; print @good_array; __DATA__ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMOPQRSTUVWXYZ[\]^_`abcdefg +hijklmnopqrstuvwxyz{|}~

where you may want to change the bounds on the first foreach loop.

Replies are listed 'Best First'.
Re^2: Find what characters never appear
by Narveson (Chaplain) on Sep 04, 2009 at 22:29 UTC

    Thanks, this has been running against my big file for the past half hour. I think it will work, but it won't finish for another half hour or so, and meanwhile my ride is coming to take me home.