in reply to Re: This might not be in the spirit of iTIMTOWTDI/i
in thread This might not be in the spirit of iTIMTOWTDI/i, but...

The sequence require $module doesn't work if $module contains colons. I think there's another node here somewhere that I wrote to show how to do this with the right BEGIN{} block around it. But super search isn't super enough for me to find it quickly.

-- Randal L. Schwartz, Perl hacker

  • Comment on RE: Re: This might not be in the spirit of iTIMTOWTDI/i

Replies are listed 'Best First'.
RE: RE: Re: This might not be in the spirit of iTIMTOWTDI/i
by Zarathustra (Beadle) on Oct 07, 2000 at 05:30 UTC

    eval "require $module";

    if $module contains colons

RE: RE: Re: This might not be in the spirit of iTIMTOWTDI/i
by AgentM (Curate) on Oct 07, 2000 at 01:45 UTC
    except that (at least in my program) my module name was determined after reading in a file at runtime. It's easy enough to do if you push the path onto the @INC. Anyway, a quick split for colons would take care to push yet another path on the poor @INC :-O so the end justifies the means.
    AgentM Systems or Nasca Enterprises is not responsible for the comments made by AgentM- anywhere.