where is my map typo?

Hi All,

I am going through the examples on
    https://docs.perl6.org/type/Map.html

$ p6 "my $map =3D Map.new('a', 1, 'b', 2); say $map{'a'}; say $map{ 'a', =

'b' };"
=3D=3D=3DSORRY!=3D=3D=3D Error while compiling -e
Malformed my
at -e:1
------> my=E2=8F=8F  =3D Map.new('a', 1, 'b', 2); say {'a'};

What the heck is a 'Malformed my"?  I copied and pasted
from the second set of examples.

And why is the first example:
      %e :=3D Map.new
and the second example
      $e =3D Map.new
?

Many thanks,
-T
0
perl6
12/4/2019 10:17:04 AM
perl.perl6.users 1438 articles. 0 followers. Follow

10 Replies
71 Views

Similar Articles

[PageSpeed] 18

--0000000000008783fa0598de5178
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

You're using doubles quotes for the string you're passing to Raku.

This means the Shell will do variable interpolation. So it see's "my $map =
=3D
Map.new()" and puts the value of it's variable $map in their.

But it doesn't exist. So Raku gets "my =3D Map.new()" (Note the space where
$map was). And complains. (You can see that in the error).

I'd advise *always* suing single quotes to pass strings into Raku on the
command line. If you need single quotes in your code use q[] instead.

So :

p6 'my $map =3D Map.new("a", 1, "b", 2); say $map{"a"}; say $map{ "a", "b"
};'

Should work just fine.

%e :=3D Map.new binds %e to the Map if you did %e =3D Map.new it will treat=
 the
Map as the first element in a list and probably complain.

On the other hand $e =3D Map.new is assigning to a Scalar so it doesn't
expect to be taking a list of values.

If that makes sense?

On Wed, 4 Dec 2019 at 10:22, ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> Hi All,
>
> I am going through the examples on
>     https://docs.perl6.org/type/Map.html
>
> $ p6 "my $map =3D Map.new('a', 1, 'b', 2); say $map{'a'}; say $map{ 'a',
> 'b' };"
> =3D=3D=3DSORRY!=3D=3D=3D Error while compiling -e
> Malformed my
> at -e:1
> ------> my=E2=8F=8F  =3D Map.new('a', 1, 'b', 2); say {'a'};
>
> What the heck is a 'Malformed my"?  I copied and pasted
> from the second set of examples.
>
> And why is the first example:
>       %e :=3D Map.new
> and the second example
>       $e =3D Map.new
> ?
>
> Many thanks,
> -T
>


--=20
Simon Proctor
Cognoscite aliquid novum cotidie

http://www.khanate.co.uk/

--0000000000008783fa0598de5178
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>You&#39;re using doubles quotes for the string you&#3=
9;re passing to Raku.</div><div><br></div><div>This means the Shell will do=
 variable interpolation. So it see&#39;s &quot;my $map =3D Map.new()&quot; =
and puts the value of it&#39;s variable $map in their.</div><div><br></div>=
<div>But it doesn&#39;t exist. So Raku gets &quot;my =3D Map.new()&quot; (N=
ote the space where $map was). And complains. (You can see that in the erro=
r).</div><div><br></div><div>I&#39;d advise *always* suing single quotes to=
 pass strings into Raku on the command line. If you need single quotes in y=
our code use q[] instead.</div><div><br></div><div>So : <br></div><div><br>=
</div><div>p6 &#39;my $map =3D Map.new(&quot;a&quot;, 1, &quot;b&quot;, 2);=
 say $map{&quot;a&quot;}; say $map{ &quot;a&quot;, &quot;b&quot; };&#39; <b=
r></div><div><br></div><div>Should work just fine.</div><div><br></div><div=
>%e :=3D Map.new binds %e to the Map if you did %e =3D Map.new it will trea=
t the Map as the first element in a list and probably complain. <br></div><=
div><br></div><div>On the other hand $e =3D Map.new is assigning to a Scala=
r so it doesn&#39;t expect to be taking a list of values.</div><div><br></d=
iv><div>If that makes sense?<br></div></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Wed, 4 Dec 2019 at 10:22, ToddAndM=
argo via perl6-users &lt;<a href=3D"mailto:perl6-users@perl.org">perl6-user=
s@perl.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">Hi All,<br>
<br>
I am going through the examples on<br>
=C2=A0 =C2=A0 <a href=3D"https://docs.perl6.org/type/Map.html" rel=3D"noref=
errer" target=3D"_blank">https://docs.perl6.org/type/Map.html</a><br>
<br>
$ p6 &quot;my $map =3D Map.new(&#39;a&#39;, 1, &#39;b&#39;, 2); say $map{&#=
39;a&#39;}; say $map{ &#39;a&#39;, <br>
&#39;b&#39; };&quot;<br>
=3D=3D=3DSORRY!=3D=3D=3D Error while compiling -e<br>
Malformed my<br>
at -e:1<br>
------&gt; my=E2=8F=8F=C2=A0 =3D Map.new(&#39;a&#39;, 1, &#39;b&#39;, 2); s=
ay {&#39;a&#39;};<br>
<br>
What the heck is a &#39;Malformed my&quot;?=C2=A0 I copied and pasted<br>
from the second set of examples.<br>
<br>
And why is the first example:<br>
=C2=A0 =C2=A0 =C2=A0 %e :=3D Map.new<br>
and the second example<br>
=C2=A0 =C2=A0 =C2=A0 $e =3D Map.new<br>
?<br>
<br>
Many thanks,<br>
-T<br>
</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature">Simon Proctor<br>Cognoscite aliquid novum cotidie<br><br><a=
 href=3D"http://www.khanate.co.uk/" target=3D"_blank">http://www.khanate.co=
..uk/</a></div>

--0000000000008783fa0598de5178--
0
simon
12/4/2019 10:31:30 AM
On Wed, Dec 4, 2019 at 2:22 AM ToddAndMargo via perl6-users
<perl6-users@perl.org> wrote:
>
> Hi All,
>
> I am going through the examples on
>     https://docs.perl6.org/type/Map.html
>
> $ p6 "my $map = Map.new('a', 1, 'b', 2); say $map{'a'}; say $map{ 'a',
> 'b' };"
> ===SORRY!=== Error while compiling -e
> Malformed my
> at -e:1
> ------> my  = Map.new('a', 1, 'b', 2); say {'a'};
>
> What the heck is a 'Malformed my"?  I copied and pasted
> from the second set of examples.

I got that to work no problem--on both the command line and in the
REPL. For the command line I just made sure that the outer quotes were
single quotes while the inner were double quotes (on a Mac):

mbook:~ homedir$ perl6 -e 'my $map = Map.new("a", 1, "b", 2); say
$map{"a"}; say $map{ "a", "b" };'
1
(1 2)
mbook:~ homedir$ perl6
To exit type 'exit' or '^D'
> my $map = Map.new("a", 1, "b", 2); say $map{"a"}; say $map{ "a", "b" };
1
(1 2)
> $*VM
moar (2019.07.1)
>

HTH, Bill.



>
> And why is the first example:
>       %e := Map.new
> and the second example
>       $e = Map.new
> ?
>
> Many thanks,
> -T
0
perl6
12/4/2019 10:39:49 AM
--0000000000007c12640598e490b3
Content-Type: text/plain; charset="UTF-8"

Just for the record, the issue is that you use double quotes on the command
line, which will interpolate any $ variables, so raku only saw the
interpolated value, which was nothing.

On Wed, Dec 4, 2019, 12:48 William Michels via perl6-users <
perl6-users@perl.org> wrote:

> On Wed, Dec 4, 2019 at 2:22 AM ToddAndMargo via perl6-users
> <perl6-users@perl.org> wrote:
> >
> > Hi All,
> >
> > I am going through the examples on
> >     https://docs.perl6.org/type/Map.html
> >
> > $ p6 "my $map = Map.new('a', 1, 'b', 2); say $map{'a'}; say $map{ 'a',
> > 'b' };"
> > ===SORRY!=== Error while compiling -e
> > Malformed my
> > at -e:1
> > ------> my  = Map.new('a', 1, 'b', 2); say {'a'};
> >
> > What the heck is a 'Malformed my"?  I copied and pasted
> > from the second set of examples.
>
> I got that to work no problem--on both the command line and in the
> REPL. For the command line I just made sure that the outer quotes were
> single quotes while the inner were double quotes (on a Mac):
>
> mbook:~ homedir$ perl6 -e 'my $map = Map.new("a", 1, "b", 2); say
> $map{"a"}; say $map{ "a", "b" };'
> 1
> (1 2)
> mbook:~ homedir$ perl6
> To exit type 'exit' or '^D'
> > my $map = Map.new("a", 1, "b", 2); say $map{"a"}; say $map{ "a", "b" };
> 1
> (1 2)
> > $*VM
> moar (2019.07.1)
> >
>
> HTH, Bill.
>
>
>
> >
> > And why is the first example:
> >       %e := Map.new
> > and the second example
> >       $e = Map.new
> > ?
> >
> > Many thanks,
> > -T
>

--0000000000007c12640598e490b3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">Just for the record, the issue is that you use double quo=
tes on the command line, which will interpolate any $ variables, so raku on=
ly saw the interpolated value, which was nothing.</div><br><div class=3D"gm=
ail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Dec 4, 2019, 12:48=
 William Michels via perl6-users &lt;<a href=3D"mailto:perl6-users@perl.org=
">perl6-users@perl.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_q=
uote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1e=
x">On Wed, Dec 4, 2019 at 2:22 AM ToddAndMargo via perl6-users<br>
&lt;<a href=3D"mailto:perl6-users@perl.org" target=3D"_blank" rel=3D"norefe=
rrer">perl6-users@perl.org</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi All,<br>
&gt;<br>
&gt; I am going through the examples on<br>
&gt;=C2=A0 =C2=A0 =C2=A0<a href=3D"https://docs.perl6.org/type/Map.html" re=
l=3D"noreferrer noreferrer" target=3D"_blank">https://docs.perl6.org/type/M=
ap.html</a><br>
&gt;<br>
&gt; $ p6 &quot;my $map =3D Map.new(&#39;a&#39;, 1, &#39;b&#39;, 2); say $m=
ap{&#39;a&#39;}; say $map{ &#39;a&#39;,<br>
&gt; &#39;b&#39; };&quot;<br>
&gt; =3D=3D=3DSORRY!=3D=3D=3D Error while compiling -e<br>
&gt; Malformed my<br>
&gt; at -e:1<br>
&gt; ------&gt; my=C2=A0 =3D Map.new(&#39;a&#39;, 1, &#39;b&#39;, 2); say {=
&#39;a&#39;};<br>
&gt;<br>
&gt; What the heck is a &#39;Malformed my&quot;?=C2=A0 I copied and pasted<=
br>
&gt; from the second set of examples.<br>
<br>
I got that to work no problem--on both the command line and in the<br>
REPL. For the command line I just made sure that the outer quotes were<br>
single quotes while the inner were double quotes (on a Mac):<br>
<br>
mbook:~ homedir$ perl6 -e &#39;my $map =3D Map.new(&quot;a&quot;, 1, &quot;=
b&quot;, 2); say<br>
$map{&quot;a&quot;}; say $map{ &quot;a&quot;, &quot;b&quot; };&#39;<br>
1<br>
(1 2)<br>
mbook:~ homedir$ perl6<br>
To exit type &#39;exit&#39; or &#39;^D&#39;<br>
&gt; my $map =3D Map.new(&quot;a&quot;, 1, &quot;b&quot;, 2); say $map{&quo=
t;a&quot;}; say $map{ &quot;a&quot;, &quot;b&quot; };<br>
1<br>
(1 2)<br>
&gt; $*VM<br>
moar (2019.07.1)<br>
&gt;<br>
<br>
HTH, Bill.<br>
<br>
<br>
<br>
&gt;<br>
&gt; And why is the first example:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0%e :=3D Map.new<br>
&gt; and the second example<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0$e =3D Map.new<br>
&gt; ?<br>
&gt;<br>
&gt; Many thanks,<br>
&gt; -T<br>
</blockquote></div>

--0000000000007c12640598e490b3--
0
rabbiveesh
12/4/2019 5:58:35 PM
On 2019-12-04 02:39, William Michels via perl6-users wrote:
> On Wed, Dec 4, 2019 at 2:22 AM ToddAndMargo via perl6-users
> <perl6-users@perl.org> wrote:
>>
>> Hi All,
>>
>> I am going through the examples on
>>      https://docs.perl6.org/type/Map.html
>>
>> $ p6 "my $map = Map.new('a', 1, 'b', 2); say $map{'a'}; say $map{ 'a',
>> 'b' };"
>> ===SORRY!=== Error while compiling -e
>> Malformed my
>> at -e:1
>> ------> my  = Map.new('a', 1, 'b', 2); say {'a'};
>>
>> What the heck is a 'Malformed my"?  I copied and pasted
>> from the second set of examples.
> 
> I got that to work no problem--on both the command line and in the
> REPL. For the command line I just made sure that the outer quotes were
> single quotes while the inner were double quotes (on a Mac):
> 
> mbook:~ homedir$ perl6 -e 'my $map = Map.new("a", 1, "b", 2); say
> $map{"a"}; say $map{ "a", "b" };'
> 1
> (1 2)
> mbook:~ homedir$ perl6
> To exit type 'exit' or '^D'
>> my $map = Map.new("a", 1, "b", 2); say $map{"a"}; say $map{ "a", "b" };
> 1
> (1 2)
>> $*VM
> moar (2019.07.1)
>>
> 
> HTH, Bill.
> 
> 
> 
>>
>> And why is the first example:
>>        %e := Map.new
>> and the second example
>>        $e = Map.new
>> ?
>>
>> Many thanks,
>> -T

Ah ha!  Thank you!
0
perl6
12/4/2019 7:02:09 PM
On 2019-12-04 02:31, Simon Proctor wrote:
> You're using doubles quotes for the string you're passing to Raku.
>=20
> This means the Shell will do variable interpolation. So it see's "my=20
> $map =3D Map.new()" and puts the value of it's variable $map in their.
>=20
> But it doesn't exist. So Raku gets "my =3D Map.new()" (Note the space=20
> where $map was). And complains. (You can see that in the error).
>=20
> I'd advise *always* suing single quotes to pass strings into Raku on th=
e=20
> command line. If you need single quotes in your code use q[] instead.
>=20
> So :
>=20
> p6 'my $map =3D Map.new("a", 1, "b", 2); say $map{"a"}; say $map{ "a", =
"b"=20
> };'
>=20
> Should work just fine.
>=20
> %e :=3D Map.new binds %e to the Map if you did %e =3D Map.new it will t=
reat=20
> the Map as the first element in a list and probably complain.
>=20
> On the other hand $e =3D Map.new is assigning to a Scalar so it doesn't=
=20
> expect to be taking a list of values.
>=20
> If that makes sense?
>=20
> On Wed, 4 Dec 2019 at 10:22, ToddAndMargo via perl6-users=20
> <perl6-users@perl.org <mailto:perl6-users@perl.org>> wrote:
>=20
>     Hi All,
>=20
>     I am going through the examples on
>     https://docs.perl6.org/type/Map.html
>=20
>     $ p6 "my $map =3D Map.new('a', 1, 'b', 2); say $map{'a'}; say $map{=
 'a',
>     'b' };"
>     =3D=3D=3DSORRY!=3D=3D=3D Error while compiling -e
>     Malformed my
>     at -e:1
>     ------> my=E2=8F=8F=C2=A0 =3D Map.new('a', 1, 'b', 2); say {'a'};
>=20
>     What the heck is a 'Malformed my"?=C2=A0 I copied and pasted
>     from the second set of examples.
>=20
>     And why is the first example:
>      =C2=A0 =C2=A0 =C2=A0 %e :=3D Map.new
>     and the second example
>      =C2=A0 =C2=A0 =C2=A0 $e =3D Map.new
>     ?
>=20
>     Many thanks,
>     -T
>=20
>=20
>=20
> --=20
> Simon Proctor
> Cognoscite aliquid novum cotidie
>=20
> http://www.khanate.co.uk/

Ah Ha!  Thank you!

--=20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
perl6
12/4/2019 7:02:23 PM
Hi Todd,

Do you not have a working Raku/Perl6 REPL install? If you do, when
copying (single-quoted) code out of https://docs.raku.org , you could
try the following strategy of pasting into the REPL first, before
pasting code at the command line:

> my $repl_code = Q[my $map = Map.new('a', 1, 'b', 2); say $map{'a'}; say $map{ 'a', 'b' };]
my $map = Map.new('a', 1, 'b', 2); say $map{'a'}; say $map{ 'a', 'b' };
> my $dashE_code = $repl_code.subst("\'", "\"", :g);
my $map = Map.new("a", 1, "b", 2); say $map{"a"}; say $map{ "a", "b" };
> say $dashE_code
my $map = Map.new("a", 1, "b", 2); say $map{"a"}; say $map{ "a", "b" };
>
> $*VM
moar (2019.07.1)

(Yes, capital "E" does nothing as a Raku/Perl6 command line flag, I
just wrote camelCase "dashE" to distinguish the letter "e").

HTH, Bill.



On Wed, Dec 4, 2019 at 11:06 AM ToddAndMargo via perl6-users
<perl6-users@perl.org> wrote:
>
> On 2019-12-04 02:31, Simon Proctor wrote:
> > You're using doubles quotes for the string you're passing to Raku.
> >
> > This means the Shell will do variable interpolation. So it see's "my
> > $map = Map.new()" and puts the value of it's variable $map in their.
> >
> > But it doesn't exist. So Raku gets "my = Map.new()" (Note the space
> > where $map was). And complains. (You can see that in the error).
> >
> > I'd advise *always* suing single quotes to pass strings into Raku on the
> > command line. If you need single quotes in your code use q[] instead.
> >
> > So :
> >
> > p6 'my $map = Map.new("a", 1, "b", 2); say $map{"a"}; say $map{ "a", "b"
> > };'
> >
> > Should work just fine.
> >
> > %e := Map.new binds %e to the Map if you did %e = Map.new it will treat
> > the Map as the first element in a list and probably complain.
> >
> > On the other hand $e = Map.new is assigning to a Scalar so it doesn't
> > expect to be taking a list of values.
> >
> > If that makes sense?
> >
> > On Wed, 4 Dec 2019 at 10:22, ToddAndMargo via perl6-users
> > <perl6-users@perl.org <mailto:perl6-users@perl.org>> wrote:
> >
> >     Hi All,
> >
> >     I am going through the examples on
> >     https://docs.perl6.org/type/Map.html
> >
> >     $ p6 "my $map = Map.new('a', 1, 'b', 2); say $map{'a'}; say $map{ 'a',
> >     'b' };"
> >     ===SORRY!=== Error while compiling -e
> >     Malformed my
> >     at -e:1
> >     ------> my  = Map.new('a', 1, 'b', 2); say {'a'};
> >
> >     What the heck is a 'Malformed my"?  I copied and pasted
> >     from the second set of examples.
> >
> >     And why is the first example:
> >            %e := Map.new
> >     and the second example
> >            $e = Map.new
> >     ?
> >
> >     Many thanks,
> >     -T
> >
> >
> >
> > --
> > Simon Proctor
> > Cognoscite aliquid novum cotidie
> >
> > http://www.khanate.co.uk/
>
> Ah Ha!  Thank you!
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Computers are like air conditioners.
> They malfunction when you open windows
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
perl6
12/4/2019 11:53:29 PM

On 2019-12-04 15:53, William Michels via perl6-users wrote:
> Do you not have a working Raku/Perl6 REPL install?

Hi William,

Being as I do not know what REPL is, I would have
to say "no".

This is the Perl I am using:

https://github.com/nxadm/rakudo-pkg/releases/download/v2019.11/rakudo-pkg-Fedora31-2019.11-01.x86_64.rpm

-T
0
perl6
12/5/2019 10:18:04 AM
REPL means "Read-Eval-Print Loop":

https://en.wikipedia.org/wiki/Read=E2=80=93eval=E2=80=93print_loop
https://softwareengineering.stackexchange.com/questions/168285/difference-b=
etween-a-repl-and-interactive-shell

What happens when you type "perl6" or "raku" at the bash command prompt?

Best Regards, Bill.

On Thu, Dec 5, 2019 at 2:22 AM Todd Chester via perl6-users
<perl6-users@perl.org> wrote:
>
>
>
> On 2019-12-04 15:53, William Michels via perl6-users wrote:
> > Do you not have a working Raku/Perl6 REPL install?
>
> Hi William,
>
> Being as I do not know what REPL is, I would have
> to say "no".
>
> This is the Perl I am using:
>
> https://github.com/nxadm/rakudo-pkg/releases/download/v2019.11/rakudo-pkg=
-Fedora31-2019.11-01.x86_64.rpm
>
> -T
0
perl6
12/5/2019 11:09:13 AM
On 2019-12-05 03:09, William Michels via perl6-users wrote:
> What happens when you type "perl6" or "raku" at the bash command prompt?

Hi William,

On my shop machine, it jumps to the next line with an
empty flashing cursor

On my office machine, it told me to install
     zef install Readline

After that, I get:

$ perl6
To exit type 'exit' or '^D'
 >

and

 > say "hello World"
hello World
 > say "B" ~ Q[:\] ~ " drive dismounted"
B:\ drive dismounted
 >

and sticking an obvious booboo into it

 > if 3 % 2 = 1 {say "odd"};
Cannot modify an immutable Int (1)
   in block <unit> at <unknown file> line 1

Plus I can use the arrow keys to recall previous lines too.

Time up update my Perl6 on my shop computer!

No more hassling with `perl6 -e` !!!

Dude!  THANK YOU !!!!!!

-T
0
perl6
12/6/2019 7:19:57 AM
On 2019-12-05 23:19, ToddAndMargo via perl6-users wrote:
> On 2019-12-05 03:09, William Michels via perl6-users wrote:
>> What happens when you type "perl6" or "raku" at the bash command promp=
t?
>=20
> Hi William,
>=20
> On my shop machine, it jumps to the next line with an
> empty flashing cursor
>=20
> On my office machine, it told me to install
>  =C2=A0=C2=A0=C2=A0 zef install Readline
>=20
> After that, I get:
>=20
> $ perl6
> To exit type 'exit' or '^D'
>  >
>=20
> and
>=20
>  > say "hello World"
> hello World
>  > say "B" ~ Q[:\] ~ " drive dismounted"
> B:\ drive dismounted
>  >
>=20
> and sticking an obvious booboo into it
>=20
>  > if 3 % 2 =3D 1 {say "odd"};
> Cannot modify an immutable Int (1)
>  =C2=A0 in block <unit> at <unknown file> line 1
>=20
> Plus I can use the arrow keys to recall previous lines too.
>=20
> Time up update my Perl6 on my shop computer!
>=20
> No more hassling with `perl6 -e` !!!
>=20
> Dude!=C2=A0 THANK YOU !!!!!!
>=20
> -T

You've created a monster!!

perl6
To exit type 'exit' or '^D'
 > my $x =3D Q[</b><br>]
</b><br>
 > say $x
</b><br>
 > (my $y =3D $x ) ~~ s/ Q[<] .* //;
=3D=3D=3DSORRY!=3D=3D=3D Error while compiling:
Unrecognized regex metacharacter < (must be quoted to match literally)
------> (my $y =3D $x ) ~~ s/ Q[<=E2=8F=8F] .* //;
 > my $x =3D Q[abc</b><br>]
abc</b><br>
 > (my $y =3D $x ) ~~ s/ '<' .* //;
=EF=BD=A2</b><br>=EF=BD=A3
 > (my $y =3D $x ) ~~ s/ '<' .* //; say $y
abc
 > (my $y =3D $x ) ~~ s/ '<' .* //; say $x; say $y
abc</b><br>
abc


Thank you!


--=20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
perl6
12/6/2019 8:05:45 AM
Reply: