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


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

Reply via email to