Re: A s/// brain teaser to share

2018-05-03 Thread yary
What you really want is to change a quote to "inch" if the quote is
not at the start of the line, not preceeded by a comma, not followed
by a comma, and not at the end of a line.

> $LabelStr ~~ s:global|"3/4\""|3/4 inch|;

But that will only fix inch when it is after 3/4
how about

> $_='"6" hand","7" foot","8 10" '
"6" hand","7" foot","8 10"
> s:g/( && ) \" / inch/; $_
"6 inch hand","7 inch foot","8 10"

I am a bit perplexed at the asymmetry - thought it would work with
s:g/ \" / inch/ - I put a
question in perl6-language about that.

-y


Re: OT: creating an icon on the task bar

2018-05-03 Thread yary
Windows? Try making a shortcut to the .pl6 file, then you can change the
icon of the shortcut, and put that in the task bar. I don't remember the
details but it ought to be enough to find it via web search.

-y

On Thu, May 3, 2018 at 8:55 PM, Todd Chester  wrote:

> Hi All,
>
> But only a little bit off topic.
>
> Windows 7 Pro, SP1, 32 bit
>
> I created a Perl6 program for a customer.  I created a shortcut
> to it on the desktop.  But Windows won't allow me to to copy
> it to the task bar as perl6 is a batch file.
>
> Looking at google, the trick of creating
>   cmd /c perl6 program.pl6
> on the desktop and dragging it to the task bar, did not
> work either
>
> How do you guys do it?
>
> -T
>


OT: creating an icon on the task bar

2018-05-03 Thread Todd Chester

Hi All,

But only a little bit off topic.

Windows 7 Pro, SP1, 32 bit

I created a Perl6 program for a customer.  I created a shortcut
to it on the desktop.  But Windows won't allow me to to copy
it to the task bar as perl6 is a batch file.

Looking at google, the trick of creating
  cmd /c perl6 program.pl6
on the desktop and dragging it to the task bar, did not
work either

How do you guys do it?

-T


Re: need <-[x]> help

2018-05-03 Thread Fernando Santagata
Hi Todd,

I tried to match a single string to begin with:

my $x = '"7" ab"';
$x ~~ s:g/ (.) \"  /inches($0)/;
say $x;

# "inches(7) ab"

On Thu, May 3, 2018 at 12:11 PM Todd Chester  wrote:

> Hi All,
>
> What I am trying to do is to replace a quote `"`
> with `inches`, but NOT when the quote is followed
> by a comma `,`.
>
> In other words, ignore `",`
>
> I am not having too good a time with it.  What am I
> doing wrong?
>
> $ perl6 -e 'my $x=qw["44","7" ab","","999"]; say
> "$x";$x~~s:g/\"(.)<-[,]>/ inches($0)/; say "$x";'
>
> "44","7" ab","","999"
> inches(4)inches(,)7inches( )binches(,)inches(,)999"
>
> desired output:
> "44","7 inches ab","","999"
>
> Many thanks,
> -T
>
> next step, ignoring the quote at the end of the line.
>


-- 
Fernando Santagata


Re: need <-[x]> help

2018-05-03 Thread jerry gay
you want a negative lookahead assertion, which are described (with an
example) at https://docs.perl6.org/language/regexes#Lookahead_Assertions

On Thu, May 3, 2018 at 3:10 AM, Todd Chester  wrote:

> Hi All,
>
> What I am trying to do is to replace a quote `"`
> with `inches`, but NOT when the quote is followed
> by a comma `,`.
>
> In other words, ignore `",`
>
> I am not having too good a time with it.  What am I
> doing wrong?
>
> $ perl6 -e 'my $x=qw["44","7" ab","","999"]; say "$x";$x~~s:g/\"(.)<-[,]>/
> inches($0)/; say "$x";'
>
> "44","7" ab","","999"
> inches(4)inches(,)7inches( )binches(,)inches(,)999"
>
> desired output:
> "44","7 inches ab","","999"
>
> Many thanks,
> -T
>
> next step, ignoring the quote at the end of the line.
>


need <-[x]> help

2018-05-03 Thread Todd Chester

Hi All,

What I am trying to do is to replace a quote `"`
with `inches`, but NOT when the quote is followed
by a comma `,`.

In other words, ignore `",`

I am not having too good a time with it.  What am I
doing wrong?

$ perl6 -e 'my $x=qw["44","7" ab","","999"]; say 
"$x";$x~~s:g/\"(.)<-[,]>/ inches($0)/; say "$x";'


"44","7" ab","","999"
inches(4)inches(,)7inches( )binches(,)inches(,)999"

desired output:
"44","7 inches ab","","999"

Many thanks,
-T

next step, ignoring the quote at the end of the line.