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

  • Home
  • SEARCH
  • 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 6704483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:17:38+00:00 2026-05-26T07:17:38+00:00

This is an embarrassing question to ask but why does this line work while

  • 0

This is an embarrassing question to ask but why does this line work while the other doesn’t?

Working line:

use strict;
use warning;
use Wx qw(:everything);
my $dialog = Wx::MessageDialog->new(
    $self,
   "About test\n" .  "Version 0.01\n",
   "About Test",
   wxOK | wxCENTRE
);

Non-working line:

use strict;
use warning;
use Wx;
my $dialog = Wx::MessageDialog->new(
   $self,
   "About test\n" .  "Version 0.01\n",
   "About Test",
   wxOK | wxCENTRE
);

Error message, from non-working line:

Bareword "wxOK" not allowed while "strict subs" in use at test.pl line 123.
Bareword "wxCENTRE" not allowed while "strict subs" in use at test.pl line 123.
BEGIN not safe after errors--compilation aborted at test.pl line 348.
  • 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-26T07:17:39+00:00Added an answer on May 26, 2026 at 7:17 am

    It is the equivalent of this:

    BEGIN {
        require 'Wx';
        Wx->import( ':everything' );
    };
    

    That code will import ‘:everything’ from Wx into the current namespace. My guess is that Wx uses Exporter and has a group of things to import when called with ‘:everything’.

    You can check the Wx’s source and Exporter’s source to try to make more sense of it.

    I missed your working/non-working example. The non-working one doesn’t work because the wxOK and wxCENTRE constants are not imported into the current namespace. This is done using Exporter, as explained above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is almost embarrassing to ask, but I can't find the answer in
It's little embarrassing to ask this question. But I can't figure out a way
This is an embarrassing question, but even the well-written documentation provided with boost.interprocess hasn't
I know this is embarrassing easy but I cannot get this to work right
This is embarrassing, but here goes. Here's the page that I'm working on: www.mchenry.edu/administration/BoardSchedule.asp
Ok, this is going to be a really embarrassing question, but I looked like
This is something of an embarrassing question to ask, seeing as it is mainly
I have been working with jquery for a while so this is quite embarrassing
I think this may be my most embarrassing question to date. Why does this
Sorry, another super basic ASP.NET question. this so embarrassing. I am reading the article

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.