> On 14/08/18 12:01, ToddAndMargo wrote:
>> Hi All,
>>
>>
>> I presume this is failing as the current directory is not
>> in the "lib" path:
>>
>>
>> $ perl6 -MPrintColors 'PrintBlue( "Blue\n" );'
>> Could not open PrintBlue( "Blue" ). Failed to stat file: no such
>> file or directory
>>
>>
>> This does work, but what a lot of extra work:
>>
>> $ perl6 -e 'use lib "/home/linuxutil"; use PrintColors; PrintBlue(
>> "Blue\n" );'
>> Blue
>>
>>
>>
>> What are the rules for calling modules from the command line?
>>
>>
>> Many thanks,
>> -T

On 08/14/2018 03:16 AM, Timo Paulssen wrote:
You can just put -I lib on your commandline, but what's more important
is that you forgot to pass -e, so it was taking your code and
interpreting it as a filename. It's very unlikely that you have a file
called 'PrintBlue( "Blue\n" );' in the current directory, though.

perl6 -Ilib -MPrintColors -e 'PrintBlue( "Blue\n");' should do what you
meant to do.

HTH
   - Timo



Hi Timo,

It took me a minute to figure out that the "lib" in "Ilib"
was not part of the command.  I even searched the perl6
docs for Ilib.

$ perl6 -I./ -MPrintColors -e 'PrintBlue( "Blue\n" );'
Blue

Thank you!

-T

This time I am writing this down!

Reply via email to