Tuesday, May 17, 2005

interactive perl

I'm writing a GUI tester, which involves me deeply in Win32::GuiTest. It's been a mix of joys and frustrations. Two things have saved my mind.
  1. I'm hooked on Python's interactivity, especially when exploring a poorly-documented module. I was missing that badly in Perl; Komodo's interactive mode is only a partial substitute. This tip saved me: http://www.devx.com/tips/Tip/17304?trk=DXRSS_WEBDEV
  2. Getting a module to export its functions was giving me fits. Just adding the function names to EXPORT_OK in the .pm file only gave me "Can't locate
    auto/... (function).al"
    errors. This is black magic to me, but it fixed it: http://groups.yahoo.com/group/libwww-perl/message/1470

1 comment:

Daniel said...

Hi Catherine!

The first tip looks like a fairly good quick implementation of the Perl Debugger- but I don't see why it's any better than using the Perl Debugger itself. You can invoke the debugger with no script with 'perl -de1' (for: debugger, execute the following code, 1)

A few reasons why the Perl Debugger is a better solution (in any way I can see, at least): it accepts regular perl commands from the prompt (just the same as this script does). But it also has a command-history, so you can cursor back to prior commands... And it works with preexisting scripts. With just ~10 of the available commands in the debugger, you get a lot more power, such as expanding any data structure (with 'x expression').

If I may toot my own horn (:-) I wrote a talk on it...

Hope that's useful... I've enjoyed browsing your blog (as a perl guy, interested in Python and databases!)