just another Perl highlander
Jose Alves de Castro <[email protected]>
| Newsgroups | gmane.comp.lang.perl.fun |
|---|---|
| Message-ID | <[email protected]> |
Hi, guys.
I was trying to do a japh with a twist. Kind of a:
print "Just another Perl highlander\n";
but not using each character more then once...
This is what I got so far:
#!/usr/bin/perl
$_=lc(q{#uS69A0oThE4:%'R.?HIG*LaN&er});
y[\x1f-@]<XVQZJYPd-v >,
It does what I want it to do, but uses two "r"s and two "-"s. If anyone
could offer me some other suggestion, I'd be much appreciated :-) (this
has probably been tried before, but I couldn't find anything on it...)
BTW, here's the script I used to validate the requirement:
#!/usr/bin/perl -nw
use strict;
our %t;
next if $. == 1;
next if /^#/;
last if /^__END__$/;
chomp;
$t{$_}++ for (split //);
}{
for (sort {$t{$a} <=> $t{$b}} grep {$t{$_} > 1} keys %t) {
print "$_ -> $t{$_}\n";
}
(they're both being sent as attaches, too)
Regards to all,
jac
--
José Alves de Castro <[email protected]>
http://natura.di.uminho.pt/~jac
highlander.pl
(text/x-perl, 229 B)
#!/usr/bin/perl
$_=lc(q{#uS69A0oThE4:%'R.?HIG*LaN&er});
y[\x1f-@]<XVQZJYPd-v >,
#y!!"#$%&'()*+,-./0123456789:;<=>?@!
#XVQZJYPdefghijklmnopqrstuv !.
print
__END__
#s[\d]< >g.
abcdefghijklmnopqrstuvwxyz
^ ^ ^ ^ ^ ^
verify_highlander.pl
(text/x-perl, 218 B)
#!/usr/bin/perl -nw
use strict;
our %t;
next if $. == 1;
next if /^#/;
last if /^__END__$/;
chomp;
$t{$_}++ for (split //);
}{
for (sort {$t{$a} <=> $t{$b}} grep {$t{$_} > 1} keys %t) {
print "$_ -> $t{$_}\n";
}
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQBBOJN04mCQSd1x0g0RAtAVAJsEFhNYAu4nkqOEGLGjXnJKadpWJwCfZzlQ SUBK11JASHy3HCFDNiz5C90= =XcP2 -----END PGP SIGNATURE-----