jump to navigation

Debugging: A Perl Pet Peeve December 24, 2009

Posted by ddouthitt in Debugging, Perl, Ruby.

When Ruby hit 1.45 years ago, I tried it and fell in love with it right away. The biggest problem with Ruby is the same now as it was then: its not available on every platform; most commercial UNIXes don’t include Ruby.

Thus, I have kept up my Perl skills. However, I found that debugging is not the same – and thus a pet peeve of mine.

You can always introduce print statements – which is what one of the developers of C and UNIX maintains is the only way to go (instead of “debuggers”).

When debugging Ruby, one can do this:

p $a;

When debugging Perl, this is required instead:

use Data::Dumper;

print Dumper($a);

I’m also always confusing Dump() with Dumper() as well.

Why didn’t Perl use a simple method instead of a complicated library process? Who knows?

Even so, Perl has a sophisticated built-in debugger which Ruby does not – but as mentioned before, printing variable contents can be more profitable for debugging purposes.


No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: