Fog Creek Software
Discussion Board




Learning Perl

I've decided to dive in and learn perl. I figure it will help me brush up on my regular expressions (and other linux skills), and I've had several prospective employers mention that it would be helpful for me to know perl. I've already got experience programming in Java, C++, VB, PHP, XML, etc.

What I'm interested in finding out, from you perl gurus out there, is: what are your favorite ide/debugging tools for perl. I'd like to be able to set multiple breakpoints, step through my code, and create watches on variables (at the very least). I'd really prefer something that I can run on win32 machines (I like to set my linux boxes up as strictly command-line machines, but I like to do my development in a GUI environment).

Also, I'd really prefer something under an open source license, though (in a pinch) I'd opt for a student license or an evaluation license of a commercial program.

Thanks in advance for your recommendations.

Benji Smith
Wednesday, November 06, 2002

Most of the time I don't use an IDE for Perl; I write my code in TextPad or Xemacs, and because of the XP-like way I build most of my test cases, I generally don't feel the need for a visual debugger. The Perl interpreter does have a built-in debugger that you can invoke with the -d option on the command line, but its operation is somewhat arcane and I wouldn't recommend it if you're looking for an IDE.

But there is an option you should look into: the Perl Dev Kit from ActiveState, http://www.activestate.com . It doesn't have a full IDE per se, but it does include a visual debugger with the capabilities you describe. It also has some nifty features like the ability to compile Perl scripts into standalone executables. And yes, it runs on Win32. Eval versions are freely downloadable, but they do expire eventually (you may be able to renew them, and there may be a student license; I don't know).

One other resource you should know about is PerlMonks, http://www.perlmonks.org . The community there is hugely helpful and dedicated and can help you through any puzzling situations you may find yourself in. Check out their tutorials and Q&A sections and just lurk to see what issues other people are asking about, and you'll learn a lot.

John C.
Wednesday, November 06, 2002

Benji -

I've been doing perl for a couple of years now. Extremely useful language for many things. Couple of sugestions:

1) don't buy the individual oreilly books related to perl - get the perl CD from oreilly. much better value. the only thing you'll be missing, which you **may** want to buy separately is the programming perl book--the one on the CD is (last I looked) one edition behind the separate paper book. you may also want to buy the separate mastering regexes book as it's not included in the pc. Regexes are amazing, wonderful and immensely powerful. However, regexes are tricky, and testing one to make sure it's doing what you want--and no more--can take a bit of practice.

2) if you're wanting to work on a wintel platform, I recommend using cygwin and perl as the environment. I have absolutely nothing against active state's win32 perl at all, it's just that I like the cygwin environment better. Of course, there's nothing to keep you from installing both on your "winders" box, either. You may find some perl modules from cpan don't quite run right (so far only had problems with Digest::MD5) in the cygwin environment, but normally that's just because they're not "pure perl" and may require you to recompile a component or two locally under cygwin's gcc. Pure perl modules will typically give you no hassles on cygwin. Normally, where such issues would arise, active state has already handled them for you, which is why you might want that environment also(or instead).

3) if you're involved in any web work, you've got to check out LWP bundle. The author, Gisle Aas, has contributed immensely to expanding perl's capabilities in the web arena, both on the client and server sides (he now works at Active State). LWP and the related web modules for perl will be invaluable to you if your perl work will be in that area.

4) Regarding debugging, perl has its own debugger; you invoke it with the '-d' command line switch, provided this capability has been compiled into the version you're running. The following is from ch 6 of OReilly's "Perl in a Nutshell" , and will head you in the right direction on debugging:

"The major focus of this chapter is the Perl debugger, which provides an interactive Perl environment. The chapter also describes the use of the DProf module and the dprofpp program that comes with it; together they can provide you with a profile of your Perl script. If you've ever used any debugger, and you understand concepts such as breakpoints and backtraces, you'll have no trouble learning to use the Perl debugger. Even if you haven't used another debugger, the command descriptions and some experimenting should get you going."

Also, learn about the '-w' switch you add to your programs (warnings goto the console), as well as 'die', 'carp', 'cluck', 'confess', and 'croak' which give you varying degrees of debugging and error info, including stack traces.

5) Welcome to the world of perl -- you're gonna enjoy it.

anonQAguy
Wednesday, November 06, 2002


I use textpad.  I'm a VC++ programmer, but I've found that you don't really need an IDE for perl if you know what you're doing.

If you realllly want an IDE, I'd recommend visual studio.net and perl.net by activestate.  I still get by just fine with printf, and on the C++ side, I'm working on shrink-wrapped world-class software.

Matt H.
Wednesday, November 06, 2002

If you are on Win32 I really recommend Komodo from http://www.activestate.com/ . It's exactly what you search. It has a syntax highlighting editor, instant syntax check (just as the red-underlining spell-check from some word processors), a built-in debugger, multiple breakpoints, variable watching including inspecting arrays and hashes and much more. If you are developing commercially with PERL that's the tool to go for because it's a real time saver. If you are not developing commercially it's quite expensive.

I second the opinion to go for the current version of the PERL CD bookshelf from O'Reilly.

Also http://www.perl.org/, http://www.perl.com/ and of course http://groups.google.com/groups?group=comp.lang.perl are places to visit and learn.

PERL programmer
Wednesday, November 06, 2002

If you are using perl under unix or cygwin do not forget the perl man pages.
man perl contains an index of other man pages for perl how to.
man perlre is a good quick reference regular expressions
man perlfaq often has the answers to common mistakes.

Become familiar with the types of information available in the other sections of the perl man pages.

DB
Wednesday, November 06, 2002

ptkdb!

Great debugger with TK interface. Has save me several times. You can get it through CPAN or Activestate.

Have fun, Robert

robert
Thursday, November 07, 2002

When I was reading your message, Komodo came to mind. You really should try it as PERL programmer said. You can use a 21 days trial license or a free educational one. It's as good as it comes.

David
Thursday, November 07, 2002

I've been coding in perl for several years on unix & pc now, and the closest I've come to an IDE are a homegrown syntax-highlighting editor (which has the sole debugging capability of invoking perl with "-d"), and emacs.

I wouldn't worry about an IDE right off the bat, just dive in with $ENV{EDITOR} and have fun.  When you get to a substantial project, then I'd look at the ones mentioned above.  I've my eye on Komodo for home use, but its price doesn't easily lend itself to that.

Oh, also, one book I'd recommend: the Perl Pocket Reference by O'Reilly.  Five bucks, and tons of time saved.

van pelt
Thursday, November 07, 2002

>>>what are your favorite ide/debugging tools for perl

Visual SlickEdit. It's not free but the productivity gains achieved is worth it.

Tom Vu
Friday, November 08, 2002

*  Recent Topics

*  Fog Creek Home