Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (26 sloc) 1.78 KB

To Ruby, From Perl

Dear Ruby,
What the hell.


Running it

  1. $ ruby to_ruby_from_perl.rb 1 - runs the first file. Run it with the source open. It won't be that interesting by itself.

  2. Read the top of to_ruby_from_perl.rb

  3. Continue running each one. Some include a Perl version of the same file for you to compare. At some points, there is no Perl equivalent (although there should be).


Take comfort in my opinion that the switch from Perl to Ruby is a good move. And many of the Perlisms will seem familiar to you. However, what you gain in readability, modernization, power, speed and happiness might change you as a coder in the best ways possible. I have no control group but I have enjoyed computer science more since learning Ruby. It truely is a thing of beauty and the language is really just the beginning. Wait until you learn some popular gems (like Perl modules or libraries) and DSLs ...

Do the Ruby Koans instead

I encourage you to do the Ruby Koans instead of studying this project. They present a high quality experience and cover more topics.

However, the Ruby Koans kind of start you out from scratch. This project is an attempt to take someone through Ruby as fast as possible using their Perl knowledge. I try to do a bit of a compare and contrast with a Rosetta stone 1:1 translation at first and then get into the fun DSL and library stuff.


The problem with this technique is that it encourages someone to write Perl in Ruby. Eventually, you'll want to pick up Eloquent Ruby to learn more Ruby-ish style.

It's only natural, I do this too. I write Ruby in Python when I have to write Python. But try to fight it.


This software is distributed under the Do WTF You Want To Public License (WTFPL).