#!/usr/bin/perl -w use strict; $_=" 0000 0000 000000 000000 000000 000000 0000 0000 0000000000 000000 000000000000 00000000 00 000000 00 00 00 00 00 000000 00 00 0000 00 00 000000 00 00 000000 00 00 000000 00 00 00000000 00 000000 0000000000 000000 000000000000 00 00 00000000000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "; $$=q;02e05f08f08e0b401709e0cb0980cd0f9115 13412d13c0620680b406c07301500d013006;; my($a,$t,@a,@b);$_.=" \n"x4;@b=($$=~m;...;g); for(split/\n/){$a=-5;$t=0;for(split//){$t+=$a if/0/;$a++;}push@a,$t;}print grep{$_=chr ($_+120-hex shift@b)}@a;
Got the person idea from physi. A dissection is welcomed/challenged :)

Replies are listed 'Best First'.
Re: The Perl Couple
by jmcnamara (Monsignor) on May 11, 2001 at 19:28 UTC

    Your code looks like this:
    #!/usr/bin/perl -wl use strict; my $str_a = " 0000 0000 000000 000000 000000 000000 0000 0000 0000000000 000000 000000000000 00000000 00 000000 00 00 00 00 00 000000 00 00 0000 00 00 000000 00 00 000000 00 00 000000 00 00 00000000 00 000000 0000000000 000000 000000000000 00 00 00000000000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "; my $str_b = '02e05f08f08e0b401709e0cb0980cd0f9115'. '13412d13c0620680b406c07301500d013006'; my ( $a, $t, @a, @b ); $str_a .= " \n" x 4; @b = ( $str_b =~ m/.../g ); # Nice foreach my $line ( split /\n/, $str_a ) { $a = -5; $t = 0; foreach my $char ( split //, $line ) { $t += $a if $char =~ /0/; $a++; } push @a, $t; } print grep{$_ = chr( $_ + 120 - hex shift @b )}@a;

    You are creating two arrays of 24 elements, one for each character of "Just another Perl hacker".

    The elements in the @a array are based on the total number of 0's in each line of the image (including 4 additional semi-blank lines).

    The elements in the @b array are hexidecimal numbers split out of the $$ string. These arrays act like masks which you add together to generate the JAPH.


    John.
    --

(arturo) Re: The Perl Couple (bad pun alert!)
by arturo (Vicar) on May 11, 2001 at 22:14 UTC

    So, would this be a Perl people eater? /me runs away

    perl -e 'print "How sweet does a rose smell? "; chomp $n = <STDIN>; $r +ose = "smells sweet to degree $n"; *other_name = *rose; print "$other +_name\n"'
Re: The Perl Couple
by Anonymous Monk on May 12, 2001 at 00:28 UTC
    (it's iamcal here) It seems like there's a bug in Perl 5.6.1 relating to rexexps with the /s modifier. See comments on my last JAPH...
Re: The Perl Couple
by muzakfetch (Scribe) on May 11, 2001 at 22:00 UTC
    I get the following output in Linux:

    2 $ perl people.pl
    Illegal hexadecimal digit ' ' ignored at people.pl line 28.
    Illegal hexadecimal digit ' ' ignored at people.pl line 28.
    Illegal hexadecimal digit ' ' ignored at people.pl line 28.
    Illegal hexadecimal digit ' ' ignored at people.pl line 28.
    Illegal hexadecimal digit ' ' ignored at people.pl line 28.
    Illegal hexadecimal digit ' ' ignored at people.pl line 28.
    Illegal hexadecimal digit ' ' ignored at people.pl line 28.
    Ju»¤aþÅÅÄÅÆÉɧɧÅÅÄ´Åþ¿¿¿¸þ¿¿¿¶§þ¿¿¿²¸þ¿¿¿©þ¿¿¿§¸13:57:42

    ??
      What perl version are you running?
        /home/perl/lib/5.6.0/ppc-linux-thread-multi
Re: The Perl Couple
by Anonymous Monk on May 11, 2001 at 19:28 UTC
    This code doesn't work!
      It works fine. Try adding  print "\n"; to the end of the script and then run it again.

      Many JAPHs do not put a newline at the end of their output, and lack of a newline on some displays may make the result difficult to notice.