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 446253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:27:09+00:00 2026-05-12T21:27:09+00:00

You know how Moose automatically turns on strict and warnings during import? I want

  • 0

You know how Moose automatically turns on strict and warnings during import? I want to extend that behavior by turning on autodie and use feature ':5.10' in my Moose classes.

I’ve tracked down where Moose does this, in Moose::Exporter, which assembles a custom import sub for Moose that calls strict->import and warnings->import for the calling class.

However, I can’t figure out a way to extend this import method in a Moose-ish way.

How should I handle this?

http://www.friedo.com/bullwinkle.gif

  • 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-12T21:27:09+00:00Added an answer on May 12, 2026 at 9:27 pm

    Since there are many ways a module might export its functions into the use-ing namespace, you may need to do some code digging in order to implement each desired library. What you’re asking for isn’t anything specific to Moose, so you can write your or your company’s own best practices module which will set up a group of standards for you to work with, e.g.

    use OurCompany::BestPractices::V1;
    

    with

    package OurCompany::BestPractices::V1;
    
    use strict;
    use warnings;
    use feature (':5.10');
    require Fatal;
    require Moose;
    
    # Required for straight implementation of autodie code
    our @ISA;
    push @ISA, qw(
       Fatal
    );
    
    sub import {
       my $caller = caller;
       strict->import;
       warnings->import;
       feature->import( ':5.10' );
       Moose->import ({into => $caller});
    
       #autodie implementation copied from autodie source
       splice(@_,1,0,Fatal::LEXICAL_TAG);
       goto &Fatal::import;
    }
    
    1;
    

    Autodie makes things a little more complicated since it relies on finding the use-er’s package from caller() and uses the goto, but you may be able to find a better way with more testing. The more you implement, the more complicated this library might be, but it might be of high enough value for you to have the one-off solution that you can use within all you or your company’s code.

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

Sidebar

Related Questions

I want to know that can mouse click event detects colors or even strings.
We use Moose classes that serialize iterators into various output formats. We describe the
I am new to selenium .. I want to know how the mouse arrow
Does anyone know how to get the correct mouse position during a drag-and-drop operation
I want to know when all of the events for a mouse event have
I want Image button with two state(normal , mouse over). that button must change
i'm working on site like http://artofflightmovie.com/ , i know how to achieve that effect
I have a series of Moose objects that I'm looking to feed to JSON::XS
My EventToCommand definition contains some sophisticated CommandParameter which I want to be automatically updated
I frequently use Moose to make sure my data have suitable default values, like

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.