Not quite. A list grep in a scalar context return the size of the list.
sub invert { #23456789012345678901234567890 grep/[^\Q@_\E]/,map{chr}1..255 }; $inverted = invert( 'Just Another Perl Hacker!' ); print $inverted; 237
237 + 18 (unique characters in the string) = 255.
In reply to Re: Re: Re: Re:^2 Golf: string complement
by BrowserUk
in thread Golf: string complement
by japhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |