Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6169791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:55:03+00:00 2026-05-23T22:55:03+00:00

An example to illustrate is the Synopsis of my own Test::Version . use Test::More;

  • 0

An example to illustrate is the Synopsis of my own Test::Version.

use Test::More;
use Test::Version 0.04;

# test blib or lib by default
version_all_ok();

done_testing;

I don’t have to include parenthesis on done_testing(); I can simply call it. However when I’ve tried to call version_all_ok; ( note: First attempt at Dist::Zilla::Plugin::Test::Version failed this way) I get an error. Why is this?

Update Perhaps my example is not quite as good as I’ve thought. The actual error I’ve gotten is

Bareword "version_all_ok" not allowed while "strict subs" in use at t/release-test-version.t line 19.

and here’s the full code

#!/usr/bin/perl

BEGIN {
  unless ($ENV{RELEASE_TESTING}) {
    require Test::More;
    Test::More::plan(skip_all => 'these tests are for release candidate testing');
  }
}

use 5.006;
use strict;
use warnings;
use Test::More;

eval "use Test::Version";
plan skip_all => "Test::Version required for testing versions"
    if $@;

version_all_ok; # of course line 19, and version_all_ok() works here.
done_testing;

The following should be relevant snippets pulled from Test::Version 1.0.0 for exportation.

use parent 'Exporter';
our @EXPORT = qw( version_all_ok ); ## no critic (Modules::ProhibitAutomaticExportation)
our @EXPORT_OK = qw( version_ok );
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:55:04+00:00Added an answer on May 23, 2026 at 10:55 pm

    Fundamentally, because Perl needs to know that a bareword means a function call in order to parse it as a function call. There are two ways Perl might learn this interesting fact:

    1. You might have decorated the bareword like a function call, prepending & or -> or appending (...) or both. Perl will trust that you know what you’re talking about and parse the bareword as a function call even if it doesn’t yet know what function it will have to call.

    2. You might have declared a function with that name before Perl tries to parse the call. Ordinarily, use-ing a module is enough to ensure the symbols get created at the right time; you’re doing something wrong in Test::Version such that the symbol is not getting exported until after it is needed to compile the test script.

    In your code, you wrap the use inside an eval, which effectively delays it until execution time. Consequently, the symbol version_all_ok is not available when Perl tries to compile the call and it blows up. Forcing the eval to compile time should suffice to make the symbol available:

    BEGIN {
        eval "use Test::Version";
        plan skip_all => "Test::Version required for testing versions"
            if $@;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

An application specific example to illustrate my immediate problem: I have a metadata provider
Is it possible to implement autoboxing for your own classes? To illustrate my example,
I will use a simple example to illustrate my question. In Java, C, or
I have created the following example to illustrate a problem I have with a
a common example to illustrate the benefits of DLR is to use it with
Using a basic example to illustrate my problem I have 2 near-identical bits of
I have this example here to illustrate the situation: http://jsfiddle.net/nubrF/40/ If you hold your
This is a simplified example to illustrate the question: class A {}; class B
I guess I'll illustrate with an example: In this game you are able to
I'll attempt to illustrate this with an example. Take a common example of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.