This is a good first try. Here are a few hints to help you out.
1 - Use $_, @_, and %_ as much as possible, also don't use long or descriptive variable names.
2 - Try to use math expressions instead of plain numbers.
3 - Use trinary instead of if if possible.
4 - Try using some evals, this lets you hide your code.

Below is an example of how you could have worked this to make it more obfuscated.

# You may want to change the name of $a $a = "a"; # Don't use a simple number, make a math statement instead # Remember that $a++ will increment after the expression is # evaluated. I used %_ as the hash to add some confusion for (1 .. (6/3*10+15/2.5)){$_{$_} = $a++;} # You may want to write a piece of code that generates # this string to hide things a bit more $c = '01010.10101.10011.10100..00001.01110.01111 .10100.01000.00101.10010..10000.00101.10010.01100. .01000.00001.00011.01011.00101.10010'; # Using @_ to add some more confusion @_= split( /\.\n*/, $c ); # Reuse $a and put your sub in it. Note the use of >> # instead of multiple if statements $a = sub {$c = 0; for (0..$#_){$c+=(16>>$_) if $_[$_];}$c;}; foreach ( 0 .. $#_ ) { # Replace your if statement with trinary, dereferance $a to call your +sub $japh.=($_[$_] ne "")?$_{&$a(split(/\s*/,$_[$_]))}:" "; } $japh =~ s/\b([a-z])/\U\1/g; print $japh,"\n"; # Here is it squished together. $a="a";for(1..(6/3*10+15/2.5)){$_{$_}=$a++;} $c='01010.10101.10011.10100..00001.01110.01111 .10100.01000.00101.10010..10000.00101.10010.01100. .01000.00001.00011.01011.00101.10010'; @_=split(/\.\n*/,$c);$a=sub{$c = 0; for(0..$#_){$c+=(16>>$_)if$_[$_];}$c;}; foreach(0..$#_){$japh.=($_[$_]ne"")? $_{&$a(split(/\s*/,$_[$_]))}:" ";} $japh =~ s/\b([a-z])/\U\1/g; print $japh,"\n";
I hope this helps you.

In reply to Re: My First JAPH by c-era
in thread My First JAPH by dsb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.