# Ex-Perl coders: Howz it feel to convert to Ruby?

**URL:** <https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600>\
**Category:** ruby-talk\
**Created:** [15 September 2004 14:54 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600 "2004-09-15T14:54:51Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![ChrisO](https://avatars.discourse-cdn.com/v4/letter/c/dec6dc/32.png) [@ChrisO](https://rubytalk.org/u/ChrisO)\
**Post date:** [16 September 2004 00:29 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/21 "2004-09-16T00:29:50Z")

</div>

Andrew Johnson wrote:

> [snip]
> 
> > So the question for any hardcore Perl coders out there that have converted to Perl (or are fluent in both) is: Is it really worth the time? Are the paybacks there? And do you feel you've exceeded your capabilities in Perl using Ruby?
> 
> I'll throw my $0.02 into the pot ...
> 
> I wouldn't call myself a "hardcore" anything, but I have used Perl a lot,  
> written about Perl a good deal, and taught a fair number of Perl courses  
> (introductory and advanced). I do like Perl.
> 
> If you are fluent in Perl and have a good grasp of OO (Perl's and/or other  
> langauges), then fluency in the Ruby language itself should be a relatively  
> quick and enjoyable experience. What \*will\* take a while longer is becoming  
> familiar enough with what is and isn't available in the standard libraries  
> or on RAA and rubyforge to become as productive as you currently are in  
> Perl (but that isn't a "language" issue per se).

Absolutely. I agree.

> I will mention that I have tried out Python on a couple of occassions, but  
> was just never seriously drawn to it.
> 
> Ruby, on the other hand, appealed to me right away. As different as Ruby  
> and Perl are, they both "fit" with how my mind thinks and solves problems  
> --- and I've always been an advocate of balancing the old axiom of "using  
> the right tool for the job" with "using the right tool for your mind". Ruby  
> and Perl are both darn good tools in my mind, and for my mind. So for me it  
> was worth it, ymmv.

I'm totally with you on all this. I've done \*exactly\* the same thing (Python and all), and I'm thinking both Perl and Ruby fit my "thinking" as well. Good post, mate.

-ceo

> **···**
>
> > On Wed, 15 Sep 2004 14:50:25 GMT, Chris \<ceo@nospan.on.net\> wrote:

---

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://rubytalk.org/u/Robert)\
**Post date:** [16 September 2004 07:34 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/22 "2004-09-16T07:34:48Z")

</div>

"Peter Hickman" \<peter@semantico.com\> schrieb im Newsbeitrag  
news:41486964.4040405@semantico.com...

> I can hack something up pretty quick in Perl, but I stand a better  
> chance of maintaining it in Ruby so I get it to work in Perl and then  
> take the design over to Ruby.

Does this work well? I assume I would do many things quite differently  
when in Perl and I wouldn't want to port that design to Ruby.

Kind regards

&nbsp;&nbsp;&nbsp;&nbsp;robert

---

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://rubytalk.org/u/Robert)\
**Post date:** [16 September 2004 07:44 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/23 "2004-09-16T07:44:49Z")

</div>

"James Edward Gray II" \<james@grayproductions.net\> schrieb im Newsbeitrag  
news:CBB35FB8-0732-11D9-B224-000A95BA45F8@grayproductions.net...

> I feel Perl has a slight edge in quick and dirty scripting. Simple  
> things like having to call to\_s() on the integers I print or

Under which circumstances do you need to\_s for numbers? What's wrong with  
this?

> > puts 1

1  
=\> nil

> > print 1, "\n"

1  
=\> nil

> > puts "foo #{1} bar"

foo 1 bar  
=\> nil

Kind regards

&nbsp;&nbsp;&nbsp;&nbsp;robert

---

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://rubytalk.org/u/Robert)\
**Post date:** [16 September 2004 16:09 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/24 "2004-09-16T16:09:47Z")

</div>

"James F. Hranicky" \<jfh@cise.ufl.edu\> schrieb im Newsbeitrag  
news:20040916115917.0ab545bf.jfh@cise.ufl.edu...

> On Wed, 15 Sep 2004 23:54:51 +0900
> 
> \> So I'm looking for feedback from those that have converted, esp. from

a

> \> hardcore Perl perspective.
> 
> Recently it dawned on me that one of the reasons I like Ruby so much is  
> method chaning. Why? At first, I thought it was because the program  
> flow went left to right, just like reading. But then it occurred to me  
> that being able to do something like this:
> 
> &nbsp;&nbsp;&nbsp;&nbsp;`ypcat -k amd_cise`.map { |line|  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line.match(/rhost:=([^;]+)/).captures[0] rescue next  
> &nbsp;&nbsp;&nbsp;&nbsp;}.compact.sort.uniq.each { |server|  
> ...
> 
> is just like using Unix pipes. When I used perl, and I needed to process  
> the output of a command like the above, I would generally do all the  
> work with a regular Unix pipeline. With ruby, the processing is very  
> similar already. You have to do a little more work, like catching  
> exceptions and things like nil elements, but the program flow is so  
> natural there's no need to exec the extra programs.

The only caveat here being to remember that typically with method chaining  
you build up one collection before the next step starts; in cases of mass  
data this can be rather impractical, whereas pipes only need limited temp  
storage (sort and other programs that need to see the whole input are an  
exception here).

But otherwise: yes, well observed!

> I recently tried hacking on some Perl (I've written thousands of lines  
> over the years), and I can barely even remember what to do, which is  
> fine, really :-\>

🙂

&nbsp;&nbsp;&nbsp;&nbsp;robert

> **···**
>
> > Chris \<ceo@nospan.on.net\> wrote:

---

<div class="post-metadata">

**Author:** ![Curt\_Hibbs3](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@Curt\_Hibbs3](https://rubytalk.org/u/Curt_Hibbs3)\
**Post date:** [15 September 2004 18:46 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/25 "2004-09-15T18:46:00Z")

</div>

Phil Tomson

> Actually things are changing. This place is hiring Ruby programmers for  
> Rails work, for example:  
> [http://robotcoop.com/](http://robotcoop.com/)
> 
> I know of another Ruby job that is probably still open in my area as well.
> 
> I'd vote for making a clean break from Perl. It might be that learning  
> Ruby and Rails will actually turn out to be a good career move (let's  
> hope).

Very interesting... I don't know where your "area" is, where is all this  
happening?

Curt

---

<div class="post-metadata">

**Author:** ![Brian\_Wisti2](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Brian\_Wisti2](https://rubytalk.org/u/Brian_Wisti2)\
**Post date:** [15 September 2004 18:51 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/26 "2004-09-15T18:51:13Z")

</div>

Hmm ... TMTOWTDI applies in both Perl and Ruby. I think I would have  
written most of your examples differently, and that difference is  
probably why Perl\<-\>Ruby isn't a big deal for me.

> (1) The complete OO nature of Ruby IMO changes everything. Perl is  
> still procedural in it's basic constructs. To iterate from 1 to 10  
> in  
> Perl can be shortened \*somewhat\* from say C or Java using this  
> construct:
> 
> for (0..9) { do\_somthing\_with( $\_ ) }

&nbsp;&nbsp;foreach my $i (0..9) { do\_something\_with($i) }

or even

&nbsp;&nbsp;map { do\_something\_with($\_) } (0..9);

> 10.times { |i| do\_something\_with( i ) }

&nbsp;&nbsp;0.upto(9) { |i| do\_something\_with(i) }

> To me, this is a significant difference and I think this gets  
> magnified  
> the deeper one goes into Ruby.

True enough, but presumably your understanding deepends as you go  
deeper into Ruby, yes?

> (2) I think the need to be familiar with the class methods and  
> properties is magnified in Ruby. This is similiar to C++ where it's  
> difficult to be productive unless one gains experience in the classes
> 
> and methods available. In Perl, this is not as much the case, again  
> do  
> to the fact you can go completely procedural in Perl and get away  
> with  
> it. If you do use OO and modules in Perl, then you only need to know
> 
> the methods for the module you imported and the rest can be  
> procedural  
> in Perl. In Ruby, it seems you can't really get away with that it  
> seems.

Sure, but POLS is a decent guideline, and when all else fails I call  
obj.methods() from irb to see what I get to play with. I generally  
don't need to refer to docs for libraries that I haven't imported, so  
I'm not sure I understand that bit.

And maybe things aren't as straightforward in Perl as you describe. One  
still has to be familiar with the full standard library, the various  
sigils, the built-in types, and all of the modules that you've  
imported.

> (3) Another contrived example, this time in Ruby:
> 
> def Contrived  
> &nbsp;&nbsp;&nbsp;&nbsp;3.times { yield }  
> end
> 
> ["tic", "tac", "toe"].each do |item|  
> &nbsp;&nbsp;&nbsp;&nbsp;Contrived { printf "%s ", item }  
> &nbsp;&nbsp;&nbsp;&nbsp;printf "\n"  
> end
> 
> There is a lot about this that is different than Perl IMO. I could  
> create an anonymous subroutine in Perl to function something like the
> 
> yield block, and I realize the Ruby above is itself somewhat  
> contrived,  
> but... still, you wouldn't normally do something like this in Perl  
> whereas in Ruby, these sorts of things are actually useful.

Useful, sure. Widely used, you betcha. Fact is that I've still never  
needed to use yield in any production code. Use what you need, not what  
you feel like you're supposed to. Your sample Perl code didn't show  
taint-checking or full conformance to strict and warnings, even though  
that is widely promoted as the "right way" to do things.

> (4) Each language has it's own strengths. IMO one of Perl's  
> strengths  
> is the simplicity and consistency of it's parameter passing:
> 
> sub shell {
> 
> &nbsp;&nbsp;&nbsp;&nbsp;my @output;  
> &nbsp;&nbsp;&nbsp;&nbsp;for (@\_) { push @output, `$_` }  
> &nbsp;&nbsp;&nbsp;&nbsp;chomp( @output );  
> &nbsp;&nbsp;&nbsp;&nbsp;return wantarray ? @output : \@output;
> 
> }
> 
> ## My favorite "Rubyism" I use all the time in Perl -- puts()!
> 
> sub puts { for (@\_) { print "$\_\n" } }
> 
> puts( shell(  
> &nbsp;&nbsp;&nbsp;&nbsp;"ls -l",  
> &nbsp;&nbsp;&nbsp;&nbsp;"ps -ef | grep -i foo",  
> &nbsp;&nbsp;&nbsp;&nbsp;"rm \*.bar",  
> ));

Yup, it's a strength of Perl, and that's a nifty puts subroutine 🙂

> So the point is I don't want to approach Ruby as Perl even though  
> there  
> are similiarities. Unfortunately, I see most people approach Perl in
> 
> the same way as C and Java and JavaScript and Perl really looses it's
> 
> benefits quickly when approached in this way. I don't want to do the
> 
> same with Ruby.

What's wrong with taking advantage of the languages that Ruby builds  
on? Familiarity with Perl, Python, Smalltalk, and LISP are all  
incredibly useful with Ruby, and sometimes a design is easiest to  
express in something resembling one of those languages.

I can see a problem with trying to make your Ruby code look \*exactly\*  
like Perl code, same as writing a C-style for(;😉 loop instead of a  
for/foreach loop in Perl is ugly. But hey, sometimes it's useful. I  
don't knock what works, as long as I can read it 🙂

> Perhaps these weak examples answer your question. And so the  
> original  
> question, clarified more (more muddied more as the case may be),  
> remains... Howz it feel to convert to Ruby \_really\_ and not just  
> applying the "Perl" mindset to Ruby, which I think is a mistake.  
> It's  
> clear from even the basic constructs it isn't the same.

Sure, it's not the same. But insisting on doing things the "Ruby Way"  
immediately is naturally going to result in a serious dip in  
productivity compared to going out and writing code that works, right  
away.

But this is a philosophical difference, and I doubt that our  
philosophical worlds will intersect much 😉

Kind Regards,

Brian Wisti  
[http://coolnamehere.com/](http://coolnamehere.com/)

---

<div class="post-metadata">

**Author:** ![Zach\_Dennis1](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@Zach\_Dennis1](https://rubytalk.org/u/Zach_Dennis1)\
**Post date:** [15 September 2004 18:54 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/27 "2004-09-15T18:54:35Z")

</div>

Chris wrote:

> Peter Hickman wrote:
> 
> > Being a long time Perl programmer I tend to reach for Perl when I have a problem to solve. Mainly because I can just grab a module off CPAN and hack something up.
> > 
> > However whenever I want to write a simulation (population models, music generators etc.) I go straight for Ruby.
> > 
> > I can hack something up pretty quick in Perl, but I stand a better chance of maintaining it in Ruby so I get it to work in Perl and then take the design over to Ruby.
> 
> Interesting, and I think I can/could continue to relate to this. As already stated, I can usually whack out a concise, tight solution in Perl in just a little bit of time. I'm anxious to see if I can get to that place in Ruby and what that would look like. This sounds like Ruby might be more suited to "bigger" tasks and Perl to the small ones. I'm sure others will jump in here momentarily and dispute this...
> 
> -ceo

I'm not a hardcore perl user. I learned perl and ruby at the same time. After a few months I dropped Perl and went with Ruby. A coworker of mine uses Perl a heck of a lot (and refuses to try Ruby...ignorance..arghh) and we did a test one day. We both wrote a script to parse out Flash ActionScript code. In one hour I was done with the requirements we had came up with. About an hour later he was finished. He even stated that my code looked cleaner then his, and mine was about 60 lines less of code. Although his code did run about 4 seconds faster per 1000 files of about 200 lines of code.

On another note I think that Perl coders like Perl because if they have a specific problem they can write up a script start to finish relatively quick to solve it. Where Perl lacks here is that if that problem changes or evolves (which they often do) and the requirements change, perl coders don't go refactor their code...they just start a whole new script and rewrite it, which works for small scripts and small problems, but not for larger ones. Perhaps this is how it should be interpreted when you say "sounds like Ruby might be more suited to "bigger" tasks and Perl to the small ones", because I would think more Ruby programmers refactor their code instead of doing a rewrite everytime a requirement changes. (Assuming that the requirement change is a month or two or more after the initial script was written).

Zach

---

<div class="post-metadata">

**Author:** ![Bill\_Kelly](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@Bill\_Kelly](https://rubytalk.org/u/Bill_Kelly)\
**Post date:** [15 September 2004 19:09 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/28 "2004-09-15T19:09:28Z")

</div>

Hi,

> As already stated, I can usually whack out a concise, tight solution in  
> Perl in just a little bit of time. I'm anxious to see if I can get to  
> that place in Ruby and what that would look like. This sounds like Ruby  
> might be more suited to "bigger" tasks and Perl to the small ones. I'm  
> sure others will jump in here momentarily and dispute this...

One of the things that thrilled me with ruby was that  
it didn't force me to give up quick one-off hack style  
scripting, in order to have a cleaner language for bigger  
tasks....

I invoke ruby from the command line fairly frequently,  
for random things like:

ruby -i -pe 'gsub(/\015/,"")' \*.cpp \*.h

If I recall my perl correctly (been about three years now)  
the perl is slightly shorter:

perl -i -pe 's/\015//g' \*.cpp \*.h

But ruby has proved sufficiently concise for my needs  
in this regard. Actually, sometimes the ruby comes out  
shorter than what I think the equivalent perl would be.

Couple days ago a friend who has been learning ruby  
asked me about making a program to gather and print a  
sorted list of all unique IP addresses in a logfile he  
had. (He said a simple string-based sort was OK, and  
the logfile structure was simple enough that a very  
basic regexp would identify IP addrs without false  
positives.) I first approached the problem with a  
hash, as I would have in Perl... and then I remembered  
ruby has Array#uniq.... So the solution ended up  
being:

puts ARGF.read.scan(/\d+\.\d+\.\d+\.\d+/).uniq.sort

=D

Not effing bad, we both thought. 🙂

Regards,

Bill

> **···**
>
> From: "Chris" \<ceo@nospan.on.net\>

---

<div class="post-metadata">

**Author:** ![David\_A\_Black3](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@David\_A\_Black3](https://rubytalk.org/u/David_A_Black3)\
**Post date:** [15 September 2004 19:41 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/29 "2004-09-15T19:41:32Z")

</div>

Hi --

> (3) Another contrived example, this time in Ruby:
> 
> def Contrived  
> &nbsp;&nbsp;&nbsp;&nbsp;3.times { yield }  
> end
> 
> ["tic", "tac", "toe"].each do |item|  
> &nbsp;&nbsp;&nbsp;&nbsp;Contrived { printf "%s ", item }  
> &nbsp;&nbsp;&nbsp;&nbsp;printf "\n"  
> end
> 
> There is a lot about this that is different than Perl IMO. I could  
> create an anonymous subroutine in Perl to function something like the  
> yield block, and I realize the Ruby above is itself somewhat contrived,  
> but... still, you wouldn't normally do something like this in Perl  
> whereas in Ruby, these sorts of things are actually useful.

Well, I would do:

&nbsp;&nbsp;puts ["tic", "tac", "toe"]

or

&nbsp;&nbsp;puts %w{ tic tac toe }

but I know you meant it just as an illustration of yield 🙂 (But  
still it's always a pleasure to see how compact and clean Ruby can  
be.)

> ## My favorite "Rubyism" I use all the time in Perl -- puts()!
> 
> sub puts { for (@\_) { print "$\_\n" } }

A perhaps slightly pedantic point: this isn't what puts actually does.  
It adds a "\n" to the end of the string only if one isn't there  
already.

David

> **···**
>
> On Thu, 16 Sep 2004, Chris wrote:
> 
> --  
> David A. Black  
> dblack@wobblini.net

---

<div class="post-metadata">

**Author:** ![Ptkwt](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Ptkwt](https://rubytalk.org/u/Ptkwt)\
**Post date:** [15 September 2004 20:41 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/30 "2004-09-15T20:41:55Z")

</div>

In article \<8x%1d.2604$Qv5.529@newssvr33.news.prodigy.com\>,

> (4) Each language has it's own strengths. IMO one of Perl's strengths  
> is the simplicity and consistency of it's parameter passing:
> 
> sub shell {
> 
> &nbsp;&nbsp;&nbsp;my @output;  
> &nbsp;&nbsp;&nbsp;for (@\_) { push @output, `$_` }  
> &nbsp;&nbsp;&nbsp;chomp( @output );  
> &nbsp;&nbsp;&nbsp;return wantarray ? @output : \@output;
> 
> }

Actually, I think this is one of the \_worst\_ things about Perl and it was  
one of those nagging little annoyances that when added up finally led me  
to seek out alternatives. The problem with the way parameters are passed  
to subroutines in Perl is that you can't tell from a glance how many  
params are supposed to be passed into the subroutine and you have no  
information about what the params are. You've got to look down through  
the subroutine code to see if there's a 'shift @\_' lurking somewhere in  
the code (for the uninitiated, you pass params to Perl subroutines via the  
'@\_' global list; you have to 'manually' shift the params off of that list  
- blech! )

Phil

> **···**
>
> Chris \<ceo@nospan.on.net\> wrote:

---

<div class="post-metadata">

**Author:** ![Ptkwt](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Ptkwt](https://rubytalk.org/u/Ptkwt)\
**Post date:** [15 September 2004 21:09 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/31 "2004-09-15T21:09:50Z")

</div>

In article \<20040915185304.GD4046@lb.tenfour\>,

> \* Phil Tomson \<ptkwt@aracnet.com\> [0909 19:09]:
> 
> > .... You know all of the methods that will operate on a particular  
> > object of a certain class (or you can easily find out) and there were more  
> > methods available on builtin classes (for example, look at all of the  
> > methods available on Array objects and compare with functions available in  
> > Perl to operate on @list objects).
> 
> That's something that shouldn't be overlooked -
> 
> when I went back to perldoc after maybe 9 months away from Perl I had  
> major problebs remembering the right function to do a particular bit  
> of manipulation on a Hash. perldoc -f isn't much use without a method name,  
> and even Google is only useful if can say what you want 🙂
> 
> With Ruby it was just 'ri Hash;ri Enumerable' to see all the methods  
> that worked on a Hash.

Or in irb:  
&nbsp;&nbsp;\> Array.methods.sort  
=\> ["&", "\*", "+", "-", "\<\<", "\<=\>", "==", "===", "=~", "", "=",  
"\_\_id\_\_", "\_\_send\_\_", "all?", "any?", "assoc", "at", "class", "clear",  
"clone", "collect", "collect!", "compact", "compact!", "concat", "delete",  
"delete\_at", "delete\_if", "detect", "display", "dup", "each",  
"each\_index", "each\_with\_index", "empty?", "entries", "eql?", "equal?",  
"extend", "fetch", "fill", "find", "find\_all", "first", "flatten",  
"flatten!", "freeze", "frozen?", "grep", "hash", "id", "include?",  
"index", "indexes", "indices", "inject", "insert", "inspect",  
"instance\_eval", "instance\_of?", "instance\_variable\_get",  
"instance\_variable\_set", "instance\_variables", "is\_a?", "join",  
"kind\_of?", "last", "length", "map", "map!", "max", "member?", "method",  
"methods", "min", "nil?", "nitems", "object\_id", "pack", "partition",  
"pop", "private\_methods", "protected\_methods", "public\_methods", "push",  
"rassoc", "reject", "reject!", "replace", "respond\_to?", "reverse",  
"reverse!", "reverse\_each", "rindex", "select", "send", "shift",  
"singleton\_methods", "size", "slice", "slice!", "sort", "sort!",  
"sort\_by", "taint", "tainted?", "to\_a", "to\_ary", "to\_s", "transpose",  
"type", "uniq", "uniq!", "unshift", "untaint", "values\_at", "zip", "|"]

It may not give you all the information about each method, but you can  
often get a pretty good idea from the name - if not, then you can use ri  
to figure it out.

Phil

> **···**
>
> Dick Davies \<rasputnik@hellooperator.net\> wrote:

---

<div class="post-metadata">

**Author:** ![ChrisO](https://avatars.discourse-cdn.com/v4/letter/c/dec6dc/32.png) [@ChrisO](https://rubytalk.org/u/ChrisO)\
**Post date:** [15 September 2004 23:19 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/32 "2004-09-15T23:19:50Z")

</div>

Phil Tomson wrote:

> In article \<20040915160327.GA4046@lb.tenfour\>,
> 
> > \* Chris \<ceo@nospan.on.net\> [0954 15:54]:
> > 
> > > I didn't even think about asking this question until now, based on a paragraph I wrote in another thread, so I thought I would ask...
> > 
> > > .....I've finally decided that the only way is to ween myself off of Perl and just start using Ruby all the way.
> > 
> > Good on you boy, although your family will starve 🙂  
> > I am still 'Writing Perl for Food', though I hope to start sneaking Ruby under  
> > the radar here now that I've settled in and earned some credit.
> 
> Actually things are changing. This place is hiring Ruby programmers for Rails work, for example:  
> [http://robotcoop.com/](http://robotcoop.com/)
> 
> I know of another Ruby job that is probably still open in my area as well.
> 
> I'd vote for making a clean break from Perl. It might be that learning Ruby and Rails will actually turn out to be a good career move (let's hope).

Actually, you've voiced something openly here that I am privately hoping. It's getting more and more difficult to keep my rates up when people can place jobs out for bid and have someone in India or Russia with an Masters degree in Computer Science complete the work in PHP, Perl or Java for rates that I can't touch. I'm hoping to tap into a "niche" market. One that perhaps doesn't exist yet, but maybe it should. Ruby is really incredible IMO. If I had have a chance of bringing it into my full-time workplace, I most certainly would. Maybe down the road, which is precisely the point.

-ceo

> **···**
>
> > Dick Davies \<rasputnik@hellooperator.net\> wrote:

---

<div class="post-metadata">

**Author:** ![Gavin\_Sinclair](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Gavin\_Sinclair](https://rubytalk.org/u/Gavin_Sinclair)\
**Post date:** [15 September 2004 23:53 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/33 "2004-09-15T23:53:55Z")

</div>

In that case, I suggest you simply read Pickaxe II for pleasure. It's  
a good survey of how to accomplish things in Ruby, and the available  
libraries to help you.

By the time you finish, you'll have enjoyed thinking differently and  
picked up enough Ruby idioms to know what's going on.

Cheers,  
Gavin

> **···**
>
> On Thursday, September 16, 2004, 4:29:50 AM, Chris wrote:
> 
> > Bill Guindon wrote:
> > 
> > > On Wed, 15 Sep 2004 23:54:51 +0900, Chris \<ceo@nospan.on.net\> wrote:
> > > 
> > > > I perceive, from what I've read, that this could be the case. I see all  
> > > > these "testimonials" that claim rapid development and this is inticing,  
> > > > yet at the same time, having done \*some\* Ruby coding, this is a little  
> > > > hard for me to believe because in my estimation, the paradigm in Ruby is  
> > > > entirely different than in just about any other procedural language and  
> > > > even from the OO aspects of Perl, C++ and Java. To me, the difference  
> > > > between Ruby and just about anything else (common) is the same as when,  
> > > > in the development world, many of us made the leap from procedural to  
> > > > OO. I think the gap between Ruby and most everything else is that big  
> > > > -- as well as the payoffs...?
> > > 
> > > One of the payoffs is the opportunity to think differently 🙂
> > 
> > Absolutely. One of my primary intriques with Ruby, to be sure...

---

<div class="post-metadata">

**Author:** ![Nate\_Smith1](https://avatars.discourse-cdn.com/v4/letter/n/9fc348/32.png) [@Nate\_Smith1](https://rubytalk.org/u/Nate_Smith1)\
**Post date:** [16 September 2004 13:17 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/34 "2004-09-16T13:17:16Z")

</div>

> Under which circumstances do you need to\_s for numbers? What's wrong with  
> this?
> 
> \>\> puts 1  
> 1  
> =\> nil  
> \>\> print 1, "\n"  
> 1  
> =\> nil  
> \>\> puts "foo #{1} bar"  
> foo 1 bar  
> =\> nil

Try

print "a" + 1

Won't work -- you have to do

print "a" + 1.to\_s

Nate

---

<div class="post-metadata">

**Author:** ![James\_Edward\_Gray\_II](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@James\_Edward\_Gray\_II](https://rubytalk.org/u/James_Edward_Gray_II)\
**Post date:** [16 September 2004 13:26 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/35 "2004-09-16T13:26:24Z")

</div>

It's usually when I'm doing something like:

puts "Total: " + 12345

James Edward Gray II

> **···**
>
> On Sep 16, 2004, at 2:44 AM, Robert Klemme wrote:
> 
> > "James Edward Gray II" \<james@grayproductions.net\> schrieb im Newsbeitrag  
> > news:CBB35FB8-0732-11D9-B224-000A95BA45F8@grayproductions.net...
> > 
> > > I feel Perl has a slight edge in quick and dirty scripting. Simple  
> > > things like having to call to\_s() on the integers I print or
> > 
> > Under which circumstances do you need to\_s for numbers? What's wrong with  
> > this?

---

<div class="post-metadata">

**Author:** ![Karl\_von\_Laudermann](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@Karl\_von\_Laudermann](https://rubytalk.org/u/Karl_von_Laudermann)\
**Post date:** [16 September 2004 16:24 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/36 "2004-09-16T16:24:48Z")

</div>

"Robert Klemme" \<bob.news@gmx.net\> wrote in message news:\<2qsugrF13g5akU1@uni-berlin.de\>...

> "James Edward Gray II" \<james@grayproductions.net\> schrieb im Newsbeitrag  
> news:CBB35FB8-0732-11D9-B224-000A95BA45F8@grayproductions.net...
> 
> \> I feel Perl has a slight edge in quick and dirty scripting. Simple  
> \> things like having to call to\_s() on the integers I print or
> 
> Under which circumstances do you need to\_s for numbers?

I can't speak for James, but coming from Java I'm used to using the  
concatenation operator, like so:

print "foo" + 1;

This causes an error; you have to call to\_s on the number. I find it  
unintuitive that specifying multible arguments to the print method is  
a way of concatenating them, so I rarely think to use it. I also find  
it unintuitive that you don't have to call to\_s when passing a  
non-string argument by itself, but you do when concatenating. Perhaps  
String#+ should be modified to call to\_s on its arguments?

BTW, one actual benefit of using concatenation vs. multiple arguments  
is that you can use puts instead of print to get a "\n" for free at  
the end, but not in between each component of your string.

---

<div class="post-metadata">

**Author:** ![Zach\_Dennis1](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@Zach\_Dennis1](https://rubytalk.org/u/Zach_Dennis1)\
**Post date:** [15 September 2004 18:59 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/37 "2004-09-15T18:59:44Z")

</div>

> I'm not a hardcore perl user. I learned perl and ruby at the same time. After a few months I dropped Perl and went with Ruby. A coworker of mine uses Perl a heck of a lot (and refuses to try Ruby...ignorance..arghh) and we did a test one day. We both wrote a script to parse out Flash ActionScript code. In one hour I was done with the requirements we had came up with. About an hour later he was finished. He even stated that my code looked cleaner then his, and mine was about 60 lines less of code. Although his code did run about 4 seconds faster per 1000 files of about 200 lines of code.
> 
> On another note I think that Perl coders like Perl because if they have a specific problem they can write up a script start to finish relatively quick to solve it. Where Perl lacks here is that if that problem changes or evolves (which they often do) and the requirements change, perl coders don't go refactor their code...they just start a whole new script and rewrite it, which works for small scripts and small problems, but not for larger ones. Perhaps this is how it should be interpreted when you say "sounds like Ruby might be more suited to "bigger" tasks and Perl to the small ones", because I would think more Ruby programmers refactor their code instead of doing a rewrite everytime a requirement changes. (Assuming that the requirement change is a month or two or more after the initial script was written).
> 
> Zach

My assumption on Perl "coders" here is my experience with them. I am not trying to stereotype the whole perl world.

Zach

---

<div class="post-metadata">

**Author:** ![Lennon\_Day-Reynolds1](https://avatars.discourse-cdn.com/v4/letter/l/5f8ce5/32.png) [@Lennon\_Day-Reynolds1](https://rubytalk.org/u/Lennon_Day-Reynolds1)\
**Post date:** [15 September 2004 19:06 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/38 "2004-09-15T19:06:07Z")

</div>

Portland, OR, and the surrounding 'burbs. I'm working at Intel using  
Ruby right now, (in a position which Phil vacated a few months ago)  
and we're looking to hire another coder to work with me. We're not the  
only group in-house using Ruby either; we're just (AFAIK) the first of  
be hiring Ruby coders specifically.

> **···**
>
> On Thu, 16 Sep 2004 03:46:00 +0900, Curt Hibbs \<curt@hibbs.com\> wrote:
> 
> > [...]  
> > Very interesting... I don't know where your "area" is, where is all this  
> > happening?
> > 
> > Curt
> 
> --  
> Lennon  
> rcoder.net

---

<div class="post-metadata">

**Author:** ![Ptkwt](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Ptkwt](https://rubytalk.org/u/Ptkwt)\
**Post date:** [15 September 2004 20:54 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/39 "2004-09-15T20:54:49Z")

</div>

In article \<EAENKKNOJPMNCDMLDOMLIENNFNAA.curt@hibbs.com\>,

> **···**
>
> Curt Hibbs \<curt@hibbs.com\> wrote:
> 
> > Phil Tomson
> > 
> > > Actually things are changing. This place is hiring Ruby programmers for  
> > > Rails work, for example:  
> > > [http://robotcoop.com/](http://robotcoop.com/)
> > > 
> > > I know of another Ruby job that is probably still open in my area as well.
> > > 
> > > I'd vote for making a clean break from Perl. It might be that learning  
> > > Ruby and Rails will actually turn out to be a good career move (let's  
> > > hope).
> > 
> > Very interesting... I don't know where your "area" is, where is all this  
> > happening?
> 
> Hillsboro, OR. The job was been advertised on this list a couple of weeks  
> ago - it may be filled by now. The jobs related to that other link are  
> in Seatle.
> 
> Phil

---

<div class="post-metadata">

**Author:** ![Bill\_Kelly](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@Bill\_Kelly](https://rubytalk.org/u/Bill_Kelly)\
**Post date:** [15 September 2004 21:02 UTC](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600/40 "2004-09-15T21:02:18Z")

</div>

> In article \<8x%1d.2604$Qv5.529@newssvr33.news.prodigy.com\>,  
> \>  
> \>(4) Each language has it's own strengths. IMO one of Perl's strengths  
> \>is the simplicity and consistency of it's parameter passing:  
> \>  
> \>sub shell {  
> \>  
> \> my @output;  
> \> for (@\_) { push @output, `$_` }  
> \> chomp( @output );  
> \> return wantarray ? @output : \@output;  
> \>  
> \>}  
> \>

In ruby that might be,

def shell(\*args)  
&nbsp;&nbsp;args.map {|a| `#{a}`.chomp}  
end

...It's true you'll always get an array back. But if  
you want to splat the array such that you can assign  
its individual element(s) to variables you can...

a = shell("echo 1", "echo 2") # a =\> ["1", "2"]  
a,b = \*shell("echo 1", "echo 2") # a =\> "1", b =\> "2"

Regards,

Bill

> **···**
>
> > Chris \<ceo@nospan.on.net\> wrote:

[Previous page](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600.md?page=1)

[Next page](https://rubytalk.org/t/ex-perl-coders-howz-it-feel-to-convert-to-ruby/13600.md?page=3)
