in reply to Re^3: Tests were run but no plan was declared and done_testing() was not seen. (Syntax::Construct)
in thread Tests were run but no plan was declared and done_testing() was not seen.

The answer to your first question is Yes. Maybe I should add "needed" after the version?

The three constructs shown in the Synopsis are the ones needed in the example code there. It's the programmer's responsibility to track them and list them. So yes, the human factor is the weakest part of the system.

Under 5.14, keys $ref already work without any switch. Specifying use Syntax::Construct qw{ auto-deref }; wouldn't change anything for you running on 5.14 (or higher), but it would give meaningful error messages to you or anyone else trying to run it on 5.12 and below. For keys $ref, the default message isn't so bad:

Type of arg 1 to keys must be hash (not scalar dereference)

but for example for $x //= 1, I'm getting

Search pattern not terminated

in 5.8.3.

It's in fact a triple-win situation:

  1. You win as the programmer, as you have all the constructs in one place (i.e. Syntax::Construct's documentation) and you don't waste your time searching through perldeltas and other places.
  2. Users of your modules win as they get meaningful error messages telling them to what Perl version they need to upgrade.
  3. The programmer they hired to workaround the problem wins as they know what constructs to replace in the code to make it run in the ancient version.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re^4: Tests were run but no plan was declared and done_testing() was not seen. (Syntax::Construct)
  • Select or Download Code

Replies are listed 'Best First'.
Re^5: Tests were run but no plan was declared and done_testing() was not seen. (Syntax::Construct)
by toolic (Bishop) on Jul 13, 2015 at 17:35 UTC
    Thanks for the information. I think some text along these lines would make a good addition to the DESCRIPTION section of your POD. To me, it really explains why someone should use this module.

    Another question: is it possible via the command line to enable all features? For example:

    perl -MSyntax::Construct=all code.pl
    I see this as a valuable debug and development tool. If I inherit someone's code (which doesn't use Syntax::Construct), and I get a cryptic message, I could edit the code and add the Syntax::Construct line. But, I'd have to know which construct gave me the message, and I'd have to edit the code (neither of which is desirable). Or am I abusing this tool?
      Do you have perlver in mind?
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
        hey thats a good idea, improve perlver so it spews Syntax::Construct self-documentation for you :)