fREWdiculous!
17 Jan
Ok, so irb is totally great for testing out some syntax and general sanity checking, but we don’t really have that with perl…or do we?
I am sure that all of the real perl hackers out there know this, but the best perl shell is your real shell. If I wanna do some cool stuff with perl I can do a lot of it directly from my shell with -e (I recommend -E as you can use ‘say’, which is helpful so that you can avoid quote issues.)
Anyway, since my brain has been so affected by ruby functional programming I have been doing a lot of:
1 | perl -Mautobox::Core -E '@f = (<*.foo>); @f->foreach(sub { ... })' |
So I am making an alias like this:
1 | alias ipl='perl -Mautobox::Core -E' |
Every little keystroke matters in such a case
Anyway, hope this helps at least remind you of the power you already have.
3 Responses for "Why it’s OK that perl doesn’t really have irb (ipl?)"
I seriously *seriously* recommend you try Devel::REPL. It’s a Moose-based interactive shell with plugin extensibility that rocks. Some of its features: multiline evaluation, lexical environment, and the killer feature (for me at least): ¡tab autocompletion of packages, variables and methods! Yes, it introspects your instances of classes (even if they are non-Moose) and shows you what methods it has. It’s awesome.
@brunov: I was actually going to post about it at some point because I recently found out about it. Awesome indeed!
perl -de0
Leave a reply