To specify the name indirectly:

my $m = 'some-module';
require ::($m);

On 2016-03-11 11:17:44 IRST, mt1957 wrote:
> Op 10-03-16 om 20:14 schreef yary:
>> There's "require" to load a module at runtime
>>
>> http://docs.perl6.org/syntax/require
>>
>> The $*REPO object controls how to search for modules,
>> http://docs.perl6.org/language/5to6-perlvar mentions it. I don't know
>> much more than that,
> Thanks for your answer,
>
> I've played a little with require in REPL but there is a problem
>
> I would like to do the following...
>
>  > my $m = 'some-module';
>  > require $m;
> Could not find 'some-documnt' in:
>      /home/marcel
>      /home/marcel/lib
>      /home/marcel/.perl6/2016.02-95-g2f78f05
>      /home/marcel/Software/perl6/rakudo/install/share/perl6/site
>      /home/marcel/Software/perl6/rakudo/install/share/perl6/vendor
>      /home/marcel/Software/perl6/rakudo/install/share/perl6
>      CompUnit::Repository::AbsolutePath<74011248>
>      CompUnit::Repository::NQP<72611240>
>      CompUnit::Repository::Perl5<72611280>
>
> while directly used it works
>
>  > require some-module;
>  >
>
> Do you think it's a bug. If so I'll write this also to rakudo-bug.
>
> Marcel

Reply via email to