[Techtalk] Improving/Reviewing a Perl script

Meryll Larkin mll at alwanza.com
Sun Sep 7 03:54:40 UTC 2014

Hi Terry,

I found this:

which is definitely your error.
I'm not sure what it means yet either.  I'll look into it some more.
I do have some questions though:
Does the script run and give you expected output when you are not testing
the code itself?

Is your script modular enough so that you can run pieces of it (unit test)
to discover exactly what part is triggering this error?

The beauty (and for some people, frustration) of Perl is TIMTOWTDI.
Sometimes there are bugs that appear when something that SHOULD work is
written in a particular way, that disappear when it is written another way.

I'm just guessing, too.  I'll see if I can find something a little more


-----Original Message-----
From: techtalk-bounces at linuxchix.org [mailto:techtalk-bounces at linuxchix.org]
On Behalf Of Terry
Sent: Saturday, September 06, 2014 3:15 PM
To: LinuchChix - techtalk
Subject: [Techtalk] Improving/Reviewing a Perl script

Hi folks,

I just wrote my first big Perl script (more than a few lines) and 
finally have it working.  Another step on my journey in learning Perl. 
I ran it through perlcritic.  What an eye opening experience!  lol  It 
definitely helped me learn even more.

I'm now reviewing my code with an eye towards improving it further if I 
can. I've read a bunch of info on refactoring and made some 
improvements. My guess is there are more to be made.

I used Devel::Cover and got this message when I ran
perl -MDevel::Cover myscripts/testing.pl:

unexpected OP_RKEYS at /usr/share/perl/5.14/B/Deparse.pm line 1113

I have no clue what this means.  I googled it and came up with nothing. 
  I also looked at line 1113 of Deparse.pm but I still don't have a 
clue.  Is this something wrong with my code or Deparse.pm?  The error 
message appears at the very end of the script, right after exit and 
right before the subs start.

Are there any other topics/tools I can research to help me improve my code?

Techtalk mailing list
Techtalk at linuxchix.org

More information about the Techtalk mailing list