Click to See Complete Forum and Search --> : Perl: My first JAPH
Been using Perl about a year now. Finally wrote my first JAPH. Take a look:
#!/usr/bin/perl
#4a75 ##737
##420 416##
##e6f #7468
#6572 20506
#5726 c2048
#61636b657
#2#######
open( FH,
$0)| | die
"nope \n";
while (<FH> )
{chomp ;if($_
=~m/^#/ ){while
($_=~m /([^#\s])/g
){$code .= $1;}}}print
pack "H48",$code;print
"\n";
YaRness
01-24-2001, 09:14 PM
it printed "_+_P¦Just Another Perl" on my box (that's some character garbage followed by JAP but no H). maybe someting got flubbed in the copy/paste process though.
if you get it right, i'd post it on perlmonks too, they seem to post JAPHs frequently.
------------------
"Assembly of Japanese bicycle require great peace of mind."
Registered Linux User #188285 http://counter.li.org/
jemfinch
01-25-2001, 07:12 AM
My favorite JAPH is:
python -c 'print "Just another Python hacker"'
http://www.linuxnewbie.org/ubb/biggrin.gif
/me runs and hides from the oncoming attacks...
Jeremy
lazy_cod3R
01-25-2001, 08:22 AM
whats a JAPH stand for http://www.linuxnewbie.org/ubb/biggrin.gif
YaRness
01-25-2001, 11:11 AM
Originally posted by jemfinch:
My favorite JAPH is:
python -c 'print "Just another Python hacker"'
http://www.linuxnewbie.org/ubb/biggrin.gif
/me runs and hides from the oncoming attacks...
Jeremy
i don't get it, does the -c directive do substitution? and why would you name a perl script "python".... http://www.linuxnewbie.org/ubb/confused.gif http://www.linuxnewbie.org/ubb/biggrin.gif
lazy_cod3R: JAPH stands for "Just Another Perl Hacker" (or prolly many other things). bored perl hackers think up new and obfuscated ways of printing out that string, like kel's example above.
------------------
"Assembly of Japanese bicycle require great peace of mind."
Registered Linux User #188285 http://counter.li.org/
tminos
01-25-2001, 01:13 PM
echo "This is a lame BASH script."
that could be because its not a BASH script. http://www.linuxnewbie.org/ubb/biggrin.gif
-kel
YaRness
01-25-2001, 02:39 PM
hey kel, i figured out what is wrong with that: take out the shebang line, or change this match: "m/^#/", so that it doesn't pick up the shebang line.
------------------
"Assembly of Japanese bicycle require great peace of mind."
Registered Linux User #188285 http://counter.li.org/
Thanks YaR.
It seems to work ok on my machine as is though. Maybe I did screw something up in the cut and paste. http://www.linuxnewbie.org/ubb/smile.gif oops.
-kel
YaRness
01-25-2001, 03:03 PM
Originally posted by kel:
Thanks YaR.
It seems to work ok on my machine as is though. Maybe I did screw something up in the cut and paste. http://www.linuxnewbie.org/ubb/smile.gif oops.
-kel
nothing got fubared in the cut and paste i don't think... i have an idea though: try running "perl whatever-your-JAPH-file-is" and see if it still works as-is.
------------------
"Assembly of Japanese bicycle require great peace of mind."
Registered Linux User #188285 http://counter.li.org/
You were right. It works as is, but when I wrote it I left 'shebang' out. I guess I forgot I was matching on a '#' when I pasted it. I must've added that in the browser.
-kel