Re: Perl 6 Module and Program File Extension Conventions?

2016-01-12 Thread Parrot Raiser
For *nix, don't use a suffix. #! does the job.

For Windows, you'll want to leave .pl and .pm for Perl 5.

On 1/12/16, Tom Browder  wrote:
> In Perl 5 it seems the prevailing convention (in my experience) is to
> use ".pl" for Perl programs and ".pm" as file suffixes for Perl
> modules.
>
> In Perl 6 I have seen in the various repos, blogs, and doc both ".pl",
> ".p6", and ".pl6" for programs and both ".pm" and ".pm6" for modules.
>
> Is there any consensus or preferred set of file extensions for Perl 6
> in use among the heavy-hitter developers?
>
> I try not to be overly concerned about such matters, but consistency
> does help IMHO, and I would like to use community best practices when
> I can
>
> Thanks.
>
> Best regards,
>
> -Tom
>


Perl 6 Module and Program File Extension Conventions?

2016-01-12 Thread Tom Browder
In Perl 5 it seems the prevailing convention (in my experience) is to
use ".pl" for Perl programs and ".pm" as file suffixes for Perl
modules.

In Perl 6 I have seen in the various repos, blogs, and doc both ".pl",
".p6", and ".pl6" for programs and both ".pm" and ".pm6" for modules.

Is there any consensus or preferred set of file extensions for Perl 6
in use among the heavy-hitter developers?

I try not to be overly concerned about such matters, but consistency
does help IMHO, and I would like to use community best practices when
I can

Thanks.

Best regards,

-Tom


Re: Perl 6 Module and Program File Extension Conventions?

2016-01-12 Thread Parrot Raiser
Looking at the documentation, http://doc.perl6.org/language/modules
see "Basic structure".

On 1/12/16, Parrot Raiser <1parr...@gmail.com> wrote:
> For *nix, don't use a suffix. #! does the job.
>
> For Windows, you'll want to leave .pl and .pm for Perl 5.
>
> On 1/12/16, Tom Browder  wrote:
>> In Perl 5 it seems the prevailing convention (in my experience) is to
>> use ".pl" for Perl programs and ".pm" as file suffixes for Perl
>> modules.
>>
>> In Perl 6 I have seen in the various repos, blogs, and doc both ".pl",
>> ".p6", and ".pl6" for programs and both ".pm" and ".pm6" for modules.
>>
>> Is there any consensus or preferred set of file extensions for Perl 6
>> in use among the heavy-hitter developers?
>>
>> I try not to be overly concerned about such matters, but consistency
>> does help IMHO, and I would like to use community best practices when
>> I can
>>
>> Thanks.
>>
>> Best regards,
>>
>> -Tom
>>
>


Re: Mooch a regex

2016-01-12 Thread Tobias Leich
First of all, your fist line contains a bug, unless the topic variable 
($_) is set to something meaningful.

Because the regex after the 'and' matches against said topic. See:

~$ perl -E '$_ = "bar"; say ("foo" =~ /f+/ and /o/)' # "", so false
~$ perl -E '$_ = "bar"; say ("foo" =~ /f+/ and /a/)' # "1", so true

I guess you wanted to match $ClickLine against both regexes.
In Perl 6 I would it as:

# Continue if any of the two match, that pipe char describes an alternation.
if $ClickLine ~~ / aes256 | $BaseTag / {
push @WebClickHere, $ClickLine;

# Capture all non-dash characters in $.
if $Line ~~ / 'select id="' $=[ <-[-]>* ] / {
push @WebVersions, $
}
}

If $BaseTag contains a regex rule, say "fo+b.r", then you'd enclose it 
in angle brackets:

if $ClickLine ~~ / aes256 | <$BaseTag> / { # ...
This is alled a "regex assertion".


Am 12.01.2016 um 20:59 schrieb ToddAndMargo:

On 01/11/2016 11:24 PM, Tobias Leich wrote:

hi, what's in ${BaseTag}? Is it a regex rule or just a plain string?
(Because that matters in Perl 6)


It is a string and can vary.

Would you show me both ways to keep me out of trouble?



Am 12.01.2016 um 01:55 schrieb ToddAndMargo:

Hi All,

Would yo all terribly mind if I ask how to do this Perl 5 regex
in Perl 6?  (I learn best by example.)



if ( $ClickLine =~ /aes256/ and /${BaseTag}/ ) {
  push ( @WebClickHere, $ClickLine );

   if ( $Line =~ m{select id=\"(.*?)[-]} ) {
  my $VerLine = $1;
  push ( @WebVersions,  $VerLine );
   }
}


Many thanks,
-T











Re: Mooch a regex

2016-01-12 Thread ToddAndMargo

On 01/11/2016 11:24 PM, Tobias Leich wrote:

hi, what's in ${BaseTag}? Is it a regex rule or just a plain string?
(Because that matters in Perl 6)


It is a string and can vary.

Would you show me both ways to keep me out of trouble?



Am 12.01.2016 um 01:55 schrieb ToddAndMargo:

Hi All,

Would yo all terribly mind if I ask how to do this Perl 5 regex
in Perl 6?  (I learn best by example.)



if ( $ClickLine =~ /aes256/ and /${BaseTag}/ ) {
  push ( @WebClickHere, $ClickLine );

   if ( $Line =~ m{select id=\"(.*?)[-]} ) {
  my $VerLine = $1;
  push ( @WebVersions,  $VerLine );
   }
}


Many thanks,
-T







--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~