#!/usr/bin/perl -w $|=8;open X,$0;grep{s;#\s(.*)#\n;$m.=$1;meg}(<X>);; # Put # @n=qw;. o 0 O 0 o;;$s=22;$m=" "x$s.$m;$l=length $m; # your # for(0..2*$l){$r=substr($m,($_%$l),$s);$r.=substr($m # message # ,0,$s-(length$r));print" $n[$_%@n] ",$r," $n[$_%@n # here. # ] \r";select($8,$',$@,.1);}print" "x($s+$|*8),"\r" # Have fun! #
An email .signature which will scroll your message across the screen, also has a 'heartbeat' animation at either side of the text.

I didn't want to obfuscate the message text itself, as I know that only a minority of the people that I send emails to actually use Perl. However, I would be grateful if anyone could offer suggestions on how I could make the code more obfuse.

Replies are listed 'Best First'.
Re: Message scroller in a .signature
by jryan (Vicar) on Oct 24, 2001 at 00:59 UTC

    First off, you can get rid of the constants. For instance, here is a devious way to set $| equal to 8:

    $|=chr(ord(substr("\cX\c9",-1))-(1<<6^2));++$|;
    Sure, its not great for golfs, but if obfu is your goal, this can certainly make someone spend a good portion of their lunch hour just figuring out the first statement. By that same token, you can change this:
    print" "x($s+$|*8),"\r"
    to this:
    print" "x($s+((($|^($|<<($=<<($|<<$|))))>>($=/($|<<$|<<$|)))<<$|<<$|)) +,"\r"
    Not the greatest golf in the world, but hey, its sexy :)

    Other than that, the program looks good. It scrolls too fast on my computer no matter how much I up the increment, but I can still see that it works. Nice job.

Re: Message scroller in a .signature
by jj808 (Hermit) on Oct 27, 2001 at 07:50 UTC
    Update: I put my golf shoes on and made the code a bit smaller - it's now only 43 characters wide (without the message). This should prevent it from being trashed by mail clients which wrap at 70 columns.
    #!/usr/bin/perl -w $,=' ';open X,$0;$m=$,x22;map{s;#\s(.*)#$;# Put # $m.=$1;meg}(<X>);$|++;$\="\r";$n='\|/-';$l# your # =length$m;for(0..2*$l){;$r=sprintf"%.22s",# message # substr($m,($_%$l),22).$m;$d=substr($n,$_%4# here. # ,1);print$,,$d,$r,$d;select($2,$',$@,.1);}# Have fun! #
    Also changed the animation from a heartbeat to a spinner.