in reply to Re: A real challenge
in thread A real challenge
or even
#!perl -w use strict; sub encode_decode ($) { my $txt = shift; my $key = 'Copyright © 2000 ActiveState Tool Corp.' x length $txt; my $enc = $txt ^ substr $key, 0, length $txt; return wantarray ? unpack "C*", $enc : $enc; } undef $/; my @encoded_ascii = encode_decode <DATA>; # one or other #my $encoded_string = ~~encode_decode <DATA>; # of these two __DATA__ #!"#$%&'()*+,-./0123456789:;<=>?@ #ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` #abcdefghijklmnopqrstuvwxyz{|}~ #!"#$%&'()*+,-./0123456789:;<=>?@ #ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` #abcdefghijklmnopqrstuvwxyz{|}~ #!"#$%&'()*+,-./0123456789:;<=>?@ #ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` #abcdefghijklmnopqrstuvwxyz{|}~ print "Show me the encoding!\n";
"Argument is futile - you will be ignorralated!"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re3: A real challenge
by bikeNomad (Priest) on Jul 16, 2001 at 20:39 UTC | |
by larryk (Friar) on Jul 16, 2001 at 20:57 UTC |
In Section
Seekers of Perl Wisdom