Ruby's irb equivalent in Perl?
Asked Answered
R

4

7

I'm from Ruby background. Just wanted to know if there is anything like Ruby's irb in perl?

Ricciardi answered 8/12, 2010 at 15:31 Comment(9)
When asking questions like this, you should explain what irb is. Otherwise, you can only get answers from people who know both Ruby and Perl.Hedva
@cjm, when asking, no need to explain. No need of answers from people, who need explaining.Moorer
@Nakilon: that's a very elitist attitude isn't it?Festus
@Nakilon, when you ask "what in language X corresponds to feature Y in language Z?" you'll get the best answers from people who know language X very well. But those people may not know Z, and are thus unfamiliar with Y, so they won't know what you're asking for unless you explain what Y is. This isn't as critical with Ruby & Perl, because there's a lot of people familiar with both, but it's still better to explain.Hedva
@cjm, OMG, if people don't know X or Z, how can they give useful answer?Moorer
@Nakilon, because they do know X, very well. What they don't know is Y and Z, which is the part that you know, or you wouldn't be asking for a Y-equivalent. If you explain enough about Y so that they know what you're looking for, they can tell you how to do it in X. Otherwise, they're going to say "I'm not going to waste my time researching Y so I can figure out what you're asking; I'll just ignore your question."Hedva
@cjm, SO is a big community. There are enough people, who knows well Ruby, Perl and other things to give an answer on this quesiotn. Questioner will lose nothing if someone, who don't know, what irb is, ignore question.Moorer
Clearly the best answer isn't going to come from the 80% of people who know X but don't know Y. It's only 4 in every 5 people who have a possible answer. Oh wait, that's wrong.Perplex
You should strive to Ask Better Questions. Everyone should at least read the how to ask page completely before asking any more questions on Stackoverflow. Google also has a similar page.Partook
C
9

Yes, there is the perl debugger. The canonical command is

perl -de 1

to open an interactive session where you can execute arbitrary Perl statements.

See perldoc perldebug for documentation.

Chair answered 8/12, 2010 at 15:42 Comment(2)
I use perl -de 1 for a work-alike too. It's not quite the same, but it's close.Sosanna
"I use perl -d -e0". Sounds like a glass-is-half-empty attitude to me. :-)Sosanna
M
6

Check the Perl::Shell module or the psh shell.

Milliner answered 8/12, 2010 at 15:45 Comment(0)
C
6

Also see Devel::REPL and iPerl.

Commissary answered 8/12, 2010 at 15:49 Comment(2)
@daxim: Devel::REPL's good, but the number of required dependencies is endlessMilliner
Tsk tsk, this is hyperbole. There are 12 non-optional deps, 2 of which are core. Try installing with CPAN, it can follow dependencies automatically.Chutney
A
1

Not exactly what you wanted, but psh is nice.

Andalusite answered 8/12, 2010 at 15:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.