Here's some super-fast code to turn any of your Perl programs (or shell scripts, or Python programs, or Ruby programs, ...) into a JAPH, despite any typos, missing modules, syntax errors, or other misgivings.
#include <stdio.h> int main (int argc) { if (argc == 1) while (getchar() != EOF) 1; printf("Just another Perl hacker\n"); }
I compiled this as prel, and ran the following program through it:
#!/usr/bin/prel use strict; print q{Just another Perl hacker.";


japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: Automatic JAPHs
by Anonymous Monk on Jul 05, 2001 at 22:26 UTC
    C is not Perl! There is no <>! No @ARGV is opened for getchar()! getchar() actually reads from STDIN!
    japhy doesn't program in C very much. BTW the syntax is good.
      I'm afraid I don't understand you.
      • C is not Perl! That is right. This was a silly bit of code. No harm done.
      • There is <>! Right.
      • No @ARGV is opened for getchar()! Right. I never actually read the file they put at the command-line. There's no reason to.
      • getchar() actually reads from STDIN! That is correct too! I read from the terminal if the user has piped a file to me, or if there are no arguments.
      • japhy doesn't program in C very much. That is not wholly true. I don't program in C nearly as much as I use Perl. However, I've been doing more C-work since I started patching Perl.
      • BTW the syntax is good. Thanks to my Perl experience, my C code is often sharp and concise.


      japhy -- Perl and Regex Hacker
      Hopefully this is sarcasm. If not, it would seem that Anonymous doesn't have the best grip on C.....