Hello there, how are you? Hope you are fine. I am a PHP programmer
trying to switch to Ruby(not for web development) because it seems easy
and what takes about 20 lines of code in PHP takes a lot fewer lines in
Ruby. However, the only thing I don't like about Ruby is its syntax.

A few weeks ago I've coded a PHP script that will take as input a LFI
vulnerable url(http://en.wikipedia.org/wiki/Local_File_Inclusion) and
will find web server logs in less than 10 seconds(that's been the
average execution time).

This week I've started to learn Ruby and for practising I wanted to
"translate" my PHP script to Ruby. The script ran successfully in Ruby
but with one problem: the script that was executed in 10 seconds in PHP,
took around 150 seconds to execute successfully in Ruby. Here is the
script: http://pastebin.com/US0wvLtR

I would like some advice from you on how to optimise my script,
regarding the execution time and any other thing that looks weird for
you.

I have been testing the script on this url
http://www.eluth.com/extras/update.php?read_me=0&readme_file= and please
take into account that the URL(ARGV[0]) needs to be encoded.

Regards!

P.S.: please don't take this post as a comparison between PHP and Ruby
or a "war" between these two languages.

-- 
Posted via http://www.ruby-forum.com/.