Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: using a variable with require

by GrandFather (Saint)
on Jun 22, 2022 at 04:02 UTC ( [id://11144935]=note: print w/replies, xml ) Need Help??


in reply to using a variable with require

See require for the full story. The short version is you need to replace :: with / and append a .pm

my $modName = 'Getopt/Long.pm'; require $modName;

Update Oops, this just answers the easy part of the question! Still thinking about the second part.

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2024-04-23 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found