Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Find what characters never appear

by bv (Friar)
on Sep 04, 2009 at 21:44 UTC ( [id://793606]=note: print w/replies, xml ) Need Help??


in reply to Find what characters never appear

Just a chance this might work:

my %chars; @chars{0 .. 127}=undef; while(<>) { for (split //) { delete $chars{ord $_} ; } } print "Chars never seen:\n"; $,="\n"; print keys %chars;

You'd have to do some logic to filter out unprintables and to show the actual characters, rather than their decimal ASCII value

print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))

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

    This ought to work. I appreciate the elegance of using the hash keys to keep track of a set, without ever updating any hash values (since after all it's only the keys that we need).

    The solution I actually ran was kennethk's above, which took over an hour. I suspect this one would take about as long, because even though it doesn't update any counts, it still reads every single character in the file.

    Thanks, your solution is running against my file right now.

    Launched it right about 22:00 GMT. I estimate it will finish in just under an hour.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://793606]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-25 15:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found