in reply to Find what characters never appear
#!/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 |