5

There seem to be several things that were valid in Embperl 1.x that are no longer supported in Embperl 2.x. As an example:

[+ +] blocks must now contain a valid Perl expression. Embperl 1.x allows you to put multiple statements into such a block. For performance reasons this is not possible anymore.

Given a very large Embperl 1.x codebase, is there an automated way to scan the .epl files and discover the incompatibilities? I don't care about implementation - anything from some special flag in Embperl 2.0 to some plugin for Perl::Critic is fine.

As long as it's not Mark 1 eyeball or "switch to Embperl2 and see what breaks" :)

DVK
  • 126,886
  • 32
  • 213
  • 327
  • Damn. I was going to answer "switch to Embperl2 and see what breaks". :-) It's the same philosophy as "add `use strict` and see what breaks", isn't it? – CanSpice Feb 10 '11 at 20:40
  • Not quite. The latter breaks on compile and can thus be immediately fixed and automatically tested. The former breaks on use in certain code paths in web apps, and possibly not fatally. – DVK Feb 10 '11 at 20:55
  • You could set up a "metainterpeter". Call eval on each line of the Embperl code, copy the state, and if the instruction barfs, log the resulting Croak or Confess... – Albert Perrien Mar 20 '11 at 01:06
  • @Albert - even if that was not feasible, again there may likely be differences that don't result in barfing but just in different behavior. – DVK Mar 20 '11 at 13:00
  • There is no automatic way to catch logic errors. Intensive use of the debugger helps, but logic errors are based on how you as a programmer determine how the code is to behave. – Albert Perrien Mar 20 '11 at 17:12

1 Answers1

2

This forum talk seem to be just what you need Migrating from embperl 1.3 to Embperl 2

The script presented there claims not only to detect the incompatibilities, but also correcting them.

Tudor Constantin
  • 26,330
  • 7
  • 49
  • 72