Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: using a variable with require

by Anonymous Monk
on Jan 24, 2023 at 00:32 UTC ( [id://11149798]=note: print w/replies, xml ) Need Help??


in reply to using a variable with require

TIMTOWTDI:
require UNIVERSAL::require; $name = 'SomeModule'; $name->require; $name->somesub();

Replies are listed 'Best First'.
Re^2: using a variable with require
by haukex (Archbishop) on Jan 24, 2023 at 10:24 UTC
    UNIVERSAL::require

    I would not recommend this. It adds two methods to the UNIVERSAL class, the base class for all Perl classes. This means that loading this module can affect every single class and object in the program.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11149798]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-03-28 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found