From: Carlos Date: 2004-02-24T00:35:48+09:00 Subject: Re: Need examples comparing Ruby to Python > >I'm putting together a web page comparing Ruby to Python, and I need > >some good examples showing off the advantages of Ruby. I'm new to > >Ruby, so all I've been able to do so far is pick some examples from > >the Programming Ruby book, and do a Google search on "compare ruby > >python". What I've found is way out-of-date. > > > > > the ruby code could be simplified: > > file, length, name, title = line.chomp.split(/\s*\|\s*/) > name.squeeze!(" ") > => > file, length, name, title =line.split /\|/ > name.strip! Do you realize that then 'file' will hold "/jazz/j00319.mp3 "? He's avoiding spaces around "|" for a reason. Also, with your "correction" the spaces between "Louis" and "Armstrong" in the name won't be squeezed.