On Wed, Jun 12, 2019 at 16:12 ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote:
> Hi Bruce, > > This has to do with the way I am importing subs from modules. > > When importing subs, I like to declare which subs I > am importing. Otherwise my code is a nightmare to maintain. > "Where the heck did that subs comes from? Is its a system > subs or ...." > > > For instance, in Perl 5: > > use Term::ANSIColor qw ( BOLD BLUE RED GREEN RESET ); > > imports "BOLD BLUE RED GREEN RESET". > > > Perl 6 has improved on this with selective importing and exporting. > The ":" is part of the tag: > > https://docs.perl6.org/language/modules#Exporting_and_selective_importing > > For instance: > > PrintColors.pm6 exports with: > > sub PrintBlue ( **@args ) is export( :PrintBlue ) { print > color('bold'), color('blue'), |@args, color('reset'); } > > The tag is `is export( :PrintBlue )` > > And imports with: > > use PrintColors :PrintRed, :PrintGreen, :PrintBlue, :PrintErr, > :PrintRedErr, :PrintGreenErr, :PrintBlueErr; > > What I am after is a way to run a one liner with > this type of export using the "-M" switch". I think you will have to file a Rakudo issue. -Tom