I'm from Ruby background. Just wanted to know if there is anything like Ruby's irb in perl?
Asked
Active
Viewed 1,031 times
7
-
3When asking questions like this, you should explain what irb is. Otherwise, you can only get answers from people who know both Ruby and Perl. – cjm Dec 08 '10 at 17:51
-
3@cjm, when asking, no need to explain. No need of answers from people, who need explaining. – Nakilon Dec 08 '10 at 21:35
-
@Nakilon: that's a very elitist attitude isn't it? – Ether Dec 08 '10 at 21:36
-
6@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. – cjm Dec 08 '10 at 22:29
-
1@cjm, OMG, if people don't know X or Z, how can they give useful answer? – Nakilon Dec 09 '10 at 00:00
-
1@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." – cjm Dec 09 '10 at 00:15
-
@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. – Nakilon Dec 09 '10 at 02:22
-
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. – Quentin Dec 09 '10 at 10:21
-
You should strive to [Ask Better Questions](http://blog.stackoverflow.com/2010/10/asking-better-questions/ "Asking Better Questions"). Everyone should at least read the [how to ask](http://stackoverflow.com/questions/how-to-ask) page **completely** before asking any more questions on Stackoverflow. Google also has a [similar page](http://googlewebmastercentral.blogspot.com/2010/09/tips-for-getting-help-with-your-site.html "Tips for Getting Help"). – Brad Gilbert Dec 09 '10 at 19:52
4 Answers
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.

mob
- 117,087
- 18
- 149
- 283
-
I use `perl -de 1` for a work-alike too. It's not quite the same, but it's close. – the Tin Man Dec 08 '10 at 21:49
-
"I use perl -d -e0". Sounds like a glass-is-half-empty attitude to me. :-) – the Tin Man Feb 16 '13 at 16:09
6
Also see Devel::REPL and iPerl.
-
@daxim: `Devel::REPL`'s good, but the number of required dependencies is endless – Eugene Yarmash Dec 09 '10 at 15:46
-
Tsk tsk, this is hyperbole. [There are 12 non-optional deps, 2 of which are core.](http://search.cpan.org/dist/Devel-REPL/Makefile.PL) Try installing with CPAN, it can follow dependencies automatically. – daxim Dec 09 '10 at 17:18