Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Variable as module name?

by kennethk (Abbot)
on Feb 01, 2013 at 23:03 UTC ( #1016621=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    my $module_name = 'Foo';
    eval "use $module_name;1;" or die "Couldn't use $module_name: $@";
  2. or download this
    use strict;
    use warnings;
    require $module_path;
    print Dumper $module->new;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016621]
[Corion]: Meh. My lack of embedded Pg is showing. I can get the data for an image gallery with one SQL statement, but not with SQLite as it doesn't do window functions :-(
[Corion]: Hmmm. Maybe I can still fake the one spot where I want/need a window function in SQLite... I think I'm never really interested in the real "next" image (not hidden/deleted)

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2018-03-23 17:47 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (295 votes). Check out past polls.