Re: Fun - Each character at most once

Eugene van der Pijll <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
[email protected] schreef:
> Can anyone improve the above so that it checks the whole of <>, not just one
> line? Bonus points for an explicit multi-character message rather than undef
> on failure. 

#!perl -0234
<>=~m{(.)[^$/]*\1}sand&two

contains no characters twice (except for the final \n), checks the whole
of <>, and prints a not-very-appropriate message on failure.

Eugene
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.