Modulino in Perl 6

2017-05-02 Thread Gabor Szabo
Using the caller() in Perl 5 one can figure out if the file was loaded as a module or executed as a script. In Python one could check if __name__ is equal to "__main__". Is there some way in Perl 6 to tell if a file was executed directly or loaded into memory as a module? regards Gabor

Re: Modulino in Perl 6

2017-05-02 Thread Larry Wall
On Tue, May 02, 2017 at 05:02:40PM +0200, Gabor Szabo wrote: : Using the caller() in Perl 5 one can figure out if the file was loaded : as a module or executed as a script. : : In Python one could check if __name__ is equal to "__main__". : : Is there some way in Perl 6 to tell if a file was exec

Re: Modulino in Perl 6

2017-05-02 Thread Gianni Ceccarelli
On Tue, 2 May 2017 17:02:40 +0200 Gabor Szabo wrote: > Is there some way in Perl 6 to tell if a file was executed directly or > loaded into memory as a module? One way that seems to work: define a ``sub MAIN``; it will be invoked when you execute the file as a program, but won't be touched if you

Need "contains" help

2017-05-02 Thread ToddAndMargo
Hi All, Why does this work $ perl6 -e 'my $x="abcdef"; if $x.contains( "abc" ) { say "yes" } else { say "no" };' yes And this does not? $ perl6 -e 'my $x="abcdef"; if $x.contains( 'abc' ) { say "yes" } else { say "no" };' ===SORRY!=== Error while compiling -e Undeclared routine: abc u

Re: Need "contains" help

2017-05-02 Thread Shrivats
Careful :-) You're actually closing the single quote you​started with perl6 -e. In other words, this is your Shell's doing. You can execute this as a script with single quote around string literals with no issues Streetcars On May 3, 2017 10:27, "ToddAndMargo" wrote: > Hi All, > > Why does th

Re: Need "contains" help

2017-05-02 Thread ToddAndMargo
On 05/02/2017 10:02 PM, Shrivats wrote: Careful :-) You're actually closing the single quote you​started with perl6 -e. In other words, this is your Shell's doing. You can execute this as a script with single quote around string literals with no issues Streetcars Mumble. I did know that. T

Re: Need "contains" help

2017-05-02 Thread ToddAndMargo
On 05/02/2017 10:02 PM, Shrivats wrote: Careful :-) You're actually closing the single quote you​started with perl6 -e. In other words, this is your Shell's doing. You can execute this as a script with single quote around string literals with no issues Streetcars Mumble. And I did know that

Re: Announce: Rakudo Star Release 2017.04

2017-05-02 Thread ToddAndMargo
On 05/01/2017 08:29 AM, Steve Mynott wrote: A useful and usable production distribution of Perl 6 I posted the following RFE: Would you please compile RPM's up for 2017.04: https://github.com/nxadm/rakudo-pkg/issues/11