http://www.perlmonks.org?node_id=1147762


in reply to Need help converting!!!

  1. Use a shebang line at the top of your program, usually followed by strict and warnings.

  2. Use print to display text to the user.

  3. Use the diamond operator (readline) to read the input.

  4. Use if and comparison operators.

    1. A block starts with a {.

      1. Use + for addition.

      2. Use ++ to increment.

      3. Use == to test numeric equality.

        1. Use = for assignment.

      4. -

      5. > is an operator.

      6. < is an operator, too.

      7. Rather than using goto, wrap the whole part in a while loop.

    2. The while condition should test whether the loop should end or not. You'll have to adjust the algorithm a bit, as you can't test before you get the input, but the test is the first thing in the loop (or last, see do).

  5. / is the division operator .

  6. Use print again.

  7. Perl terminates once it has no more lines to execute.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,