Just another Perl hacker

From Free net encyclopedia

Just another Perl hacker, or JAPH, typically refers to a Perl program which prints "Just another Perl hacker," (the comma is canonical but is occasionally omitted). Short JAPH programs are often used as signatures in online forums. The phrase or acronym is also occasionally used (without code) for a signature.

JAPH programs are classically done using extremely obfuscated methods, in the spirit of the Obfuscated C Contest. More recently, as the phenomenon has become so well known, the phrase is sometimes used in ordinary examples (without obfuscation).

The idea of using tiny Perl programs which print a signature as a signature was originated by Randal L. Schwartz, in his postings to the newsgroup comp.lang.perl.

Contents

Examples

JAPH program without obfuscation:

print "Just another Perl hacker,\n";

Embedding JAPH in opaque code:

$_='987;s/^(d+)/$1-1/e;$1?eval:print"Just another Perl hacker,"';eval;

Decoding JAPH from an encrypted string literal:

$_="krJhruaesrltre c a cnP,ohet";$_.=$1,print$2while s/(..)(.)//;

Appearing as if it does something completely unrelated to printing JAPH:

$_ = "wftedskaebjgdpjgidbsmnjgc";
tr/a-z/oh, turtleneck Phrase Jar!/; print;

Using only Perl keywords (no literals or punctuation):

 not exp log srand xor s qq qx xor
 s x x length uc ord and print chr
 ord for qw q join use sub tied qx
 xor eval xor print qq q q xor int
 eval lc q m cos and print chr ord
 for qw y abs ne open tied hex exp
 ref y m xor scalar srand print qq
 q q xor int eval lc qq y sqrt cos
 and print chr ord for qw x printf
 each return local x y or print qq
 s s and eval q s undef or oct xor
 time xor ref print chr int ord lc
 foreach qw y hex alarm chdir kill
 exec return y s gt sin sort split

Using only punctuation (no alphanumeric characters):

`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=` 

Imitations

A variant of this, practiced by programmers working on the Parrot project, involves Parrot assembly programs printing the phrase "Just another Parrot hacker":

# OO obfuscated
   bounds 1
   trace 0
   newclass P0, "Just another Parrot Hacker\n"
   shift S0, P5
   does I0, P0, S0
   add I0, 4
   bsr I0
   pack S0, 381, I0, I0
   invoke
   ret

Often Parrot JAPHs are only lightly obfuscated; they're usually intended to demonstrate or test a feature in a non-trivial use.

Additional information

See also

References

This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.

External links

pl:Just another Perl hacker ru:JAPH