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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:18:21+00:00 2026-05-30T05:18:21+00:00

I was wondering if it is possible to make sure a method in a

  • 0

I was wondering if it is possible to make sure a method in a class I make will NOT be monkey patched (Monkey patch). Can Moose achieve this?

Consider the following:

{
  package Foo;
  sub hello{print "HI"}
1;
}

package main;
sub Foo::hello {print "bye"}

Foo::hello()#bye
  • 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-30T05:18:24+00:00Added an answer on May 30, 2026 at 5:18 am

    After a quick web research i found this thread on Perlmonks that states:

    As for declaring methods final, I’m not sure how you would do it without doing something really fancy to intercept all additions to the symbol table. (Can that even be done?).

    I would also assume that it is impossible.

    Using Moose you can apply Method Modifiers that allow you to define functions that must run before a function is called.
    I have not tried this but maybe you could define a function

    before "hello" => sub{ # check if hello has been tampered with
                       }
    

    I don’t know exactly how to check it and if it even works, but it looks like it’s worth a try!

    However I would add, that since perl is an interpreted language anyone who uses your package can view and edit the source, making any precaution circumventable.

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

Sidebar

Related Questions

I'm wondering if it's possible to make a method which behaves differently when called
i'm wondering about this possibility. Is it possible to make our code written in
I'm not sure how to make the question clearer but this is bascially the
I'm not sure if anything like this is even possible, but I was told
I am wondering whether it is possible to make dynamic variables in Java. In
I'm wondering if its possible to add new class data members at run-time in
I'm sure I've seen this around before but I'm wondering how I should raise
simple question really (can hazard a guess but just need to make sure), Just
I was wondering ( if possible ) if there was a program/tool/utility that when
Just toying with the SDK and I was wondering if possible a UITouch event

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.