Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie: Ruby vs. Perl

Status
Not open for further replies.

whn

Programmer
Oct 14, 2007
265
0
0
US
I am a Perl programmer and new to Ruby.

I believe, in theory, Ruby can do whatever Perl can. But how can I tell what modules are available in Ruby? There are CORE & non-core modules in Perl. Are Ruby modules also categorized as core & non-core modules?

Specifically, what are equivalent Ruby modules for perl LWP.pm, Expect.pm. Is there a official ruby site that is similar to cpan.org?

Thanks.
 
Hi

whn said:
But how can I tell what modules are available in Ruby?
By "available" you mean exists somewhere on the internet or installed on your machine ?
In the first case you have to search the web.
In the second case I proceed similarly as when looking for installed Perl modules :
Code:
[gray]# search for Perl modules[/gray]
find $( perl -e 'print join " ",@INC' ) -name \*.pm

[gray]# search for Ruby modules[/gray]
find $( ruby -e 'puts $:.join " "' ) -name \*.rb
whn said:
Are Ruby modules also categorized as core & non-core modules?
As considerable amount of modules are also written by community members, they can also be categorized similarly. The code modules are in Ruby Standard Library.
whn said:
Specifically, what are equivalent Ruby modules for perl LWP.pm, Expect.pm.
For LWP replacement see Net::HTTP, part of the standard library.

Regarding expect, not sure. There is an expect module which defines [tt]IO.expect[/tt] ( also part of standard library ), but no idea if it does the same as the Perl module. On RubyForge there is an rexpect module, but that is quite abandoned.
whn said:
Is there a official ruby site that is similar to cpan.org?
Not sure how much official is CPAN, but I would say RubyGems is its equivalent. It has its own package manager too.


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top