Need help converting from Perl 5

Hi All,

I can't not remember what I did in Perl 5 here and
am not having a good time converting it to Perl 6.

$  perl -e 'my $A="44.rc0"; if ($A ~~ /(^[0-9,.,a,b,rc]+$)/ ) {print 
"$1\n";} else {print "\$A = <$A>\n"}'

44.rc0

The actual code is:
if ( $Line2 ~~ /(^[0-9,.]+$)/ ) { push ( @WebVersions, $Line2 ); }

The actual data looks like:

$Line2 = 6.0.1
$Line2 = 6.0.2
$Line2 = 6.0
$Line2 = 6.0b1
$Line2 = 6.0b2
$Line2 = 6.0b3
$Line2 = 6.0b4
$Line2 = 6.0b5
$Line2 = 60.0
$Line2 = 60.0b10
$Line2 = 60.0b11
$Line2 = 60.0b12

I am trying to exclude things that look like:

$Line2 = bonecho
$Line2 = custom-updates
$Line2 = deerpark
$Line2 = devpreview
$Line2 = granparadiso
$Line2 = latest-beta
$Line2 = latest-esr


Many thanks,
-T
0
ToddAndMargo
5/14/2018 4:41:09 AM
perl.perl6.users 1001 articles. 0 followers. Follow

6 Replies
35 Views

Similar Articles

[PageSpeed] 25

On 05/13/2018 09:41 PM, ToddAndMargo wrote:
> Hi All,
>=20
> I can't not remember what I did in Perl 5 here and
> am not having a good time converting it to Perl 6.
>=20
> $=C2=A0 perl -e 'my $A=3D"44.rc0"; if ($A ~~ /(^[0-9,.,a,b,rc]+$)/ ) {p=
rint=20
> "$1\n";} else {print "\$A =3D <$A>\n"}'
>=20
> 44.rc0
>=20
> The actual code is:
> if ( $Line2 ~~ /(^[0-9,.]+$)/ ) { push ( @WebVersions, $Line2 ); }
>=20
> The actual data looks like:
>=20
> $Line2 =3D 6.0.1
> $Line2 =3D 6.0.2
> $Line2 =3D 6.0
> $Line2 =3D 6.0b1
> $Line2 =3D 6.0b2
> $Line2 =3D 6.0b3
> $Line2 =3D 6.0b4
> $Line2 =3D 6.0b5
> $Line2 =3D 60.0
> $Line2 =3D 60.0b10
> $Line2 =3D 60.0b11
> $Line2 =3D 60.0b12
>=20
> I am trying to exclude things that look like:
>=20
> $Line2 =3D bonecho
> $Line2 =3D custom-updates
> $Line2 =3D deerpark
> $Line2 =3D devpreview
> $Line2 =3D granparadiso
> $Line2 =3D latest-beta
> $Line2 =3D latest-esr
>=20
>=20
> Many thanks,
> -T

perl6.org is down by the way.

Is this right?

perl6 -e 'my $A=3D"44.rc20"; if $A ~~ m/( \d**1..4 "." ( "a" | "b" | "rc"=
=20
) .*$ ) /  {say "$0";} else {say "no match";}'

44.rc20



--=20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
ToddAndMargo
5/14/2018 5:07:59 AM
>> El lun., 14 may. 2018 a las 7:08, ToddAndMargo (<ToddAndMargo@zoho.com=
=20
>> <mailto:ToddAndMargo@zoho.com>>) escribi=C3=B3:
>>=20
>>     On 05/13/2018 09:41 PM, ToddAndMargo wrote:
>>      > Hi All,
>>      >
>>      > I can't not remember what I did in Perl 5 here and
>>      > am not having a good time converting it to Perl 6.
>>      >
>>      > $  perl -e 'my $A=3D"44.rc0"; if ($A ~~ /(^[0-9,.,a,b,rc]+$)/ )=
 {print
>>      > "$1\n";} else {print "\$A =3D <$A>\n"}'
>>      >
>>      > 44.rc0
>>      >
>>      > The actual code is:
>>      > if ( $Line2 ~~ /(^[0-9,.]+$)/ ) { push ( @WebVersions, $Line2 )=
; }
>>      >
>>      > The actual data looks like:
>>      >
>>      > $Line2 =3D 6.0.1
>>      > $Line2 =3D 6.0.2
>>      > $Line2 =3D 6.0
>>      > $Line2 =3D 6.0b1
>>      > $Line2 =3D 6.0b2
>>      > $Line2 =3D 6.0b3
>>      > $Line2 =3D 6.0b4
>>      > $Line2 =3D 6.0b5
>>      > $Line2 =3D 60.0
>>      > $Line2 =3D 60.0b10
>>      > $Line2 =3D 60.0b11
>>      > $Line2 =3D 60.0b12
>>      >
>>      > I am trying to exclude things that look like:
>>      >
>>      > $Line2 =3D bonecho
>>      > $Line2 =3D custom-updates
>>      > $Line2 =3D deerpark
>>      > $Line2 =3D devpreview
>>      > $Line2 =3D granparadiso
>>      > $Line2 =3D latest-beta
>>      > $Line2 =3D latest-esr
>>      >
>>      >
>>      > Many thanks,
>>      > -T
>>=20
>>     perl6.org <http://perl6.org> is down by the way.
>>=20
>>     Is this right?
>>=20
>>     perl6 -e 'my $A=3D"44.rc20"; if $A ~~ m/( \d**1..4 "." ( "a" | "b"=
 | "rc"
>>     ) .*$ ) /  {say "$0";} else {say "no match";}'
>>=20
>>     44.rc20
>>=20

On 05/13/2018 11:41 PM, JJ Merelo wrote:
> You want to exclude lines starting with an alphabetic character, or=20
> which are composed exclusively by alphabetic characters?
>


I am trying to separate revision numbers (60.0.1, 20.0b5) from
extraneous directories (latest-esr, 20.0.1-funnelcake22)

You can see a full list before I have at it here:

https://ftp.mozilla.org/pub/firefox/releases/

I just want current releases
0
ToddAndMargo
5/14/2018 9:20:49 AM
--00000000000000abae056c274e5b
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Maybe this will work

use HTTP::UserAgent;

my $ua =3D HTTP::UserAgent.new;
$ua.timeout =3D 10;

my $response =3D $ua.get("https://ftp.mozilla.org/pub/firefox/releases/");

if $response.is-success {
    say $response.content ~~ m:g{\> (\d+ \. .+?) \/};
}
...

Please post also your question to StackOverflow, you might have better
answers there. This one works directly on the HTML source, but you will
just need to take out \> and \/ to use other. Also it's a global one, if
you work by lines it might be simpler.

El lun., 14 may. 2018 a las 11:21, ToddAndMargo (<ToddAndMargo@zoho.com>)
escribi=C3=B3:

> >> El lun., 14 may. 2018 a las 7:08, ToddAndMargo (<ToddAndMargo@zoho.com
> >> <mailto:ToddAndMargo@zoho.com>>) escribi=C3=B3:
> >>
> >>     On 05/13/2018 09:41 PM, ToddAndMargo wrote:
> >>      > Hi All,
> >>      >
> >>      > I can't not remember what I did in Perl 5 here and
> >>      > am not having a good time converting it to Perl 6.
> >>      >
> >>      > $  perl -e 'my $A=3D"44.rc0"; if ($A ~~ /(^[0-9,.,a,b,rc]+$)/ )
> {print
> >>      > "$1\n";} else {print "\$A =3D <$A>\n"}'
> >>      >
> >>      > 44.rc0
> >>      >
> >>      > The actual code is:
> >>      > if ( $Line2 ~~ /(^[0-9,.]+$)/ ) { push ( @WebVersions, $Line2 )=
;
> }
> >>      >
> >>      > The actual data looks like:
> >>      >
> >>      > $Line2 =3D 6.0.1
> >>      > $Line2 =3D 6.0.2
> >>      > $Line2 =3D 6.0
> >>      > $Line2 =3D 6.0b1
> >>      > $Line2 =3D 6.0b2
> >>      > $Line2 =3D 6.0b3
> >>      > $Line2 =3D 6.0b4
> >>      > $Line2 =3D 6.0b5
> >>      > $Line2 =3D 60.0
> >>      > $Line2 =3D 60.0b10
> >>      > $Line2 =3D 60.0b11
> >>      > $Line2 =3D 60.0b12
> >>      >
> >>      > I am trying to exclude things that look like:
> >>      >
> >>      > $Line2 =3D bonecho
> >>      > $Line2 =3D custom-updates
> >>      > $Line2 =3D deerpark
> >>      > $Line2 =3D devpreview
> >>      > $Line2 =3D granparadiso
> >>      > $Line2 =3D latest-beta
> >>      > $Line2 =3D latest-esr
> >>      >
> >>      >
> >>      > Many thanks,
> >>      > -T
> >>
> >>     perl6.org <http://perl6.org> is down by the way.
> >>
> >>     Is this right?
> >>
> >>     perl6 -e 'my $A=3D"44.rc20"; if $A ~~ m/( \d**1..4 "." ( "a" | "b"=
 |
> "rc"
> >>     ) .*$ ) /  {say "$0";} else {say "no match";}'
> >>
> >>     44.rc20
> >>
>
> On 05/13/2018 11:41 PM, JJ Merelo wrote:
> > You want to exclude lines starting with an alphabetic character, or
> > which are composed exclusively by alphabetic characters?
> >
>
>
> I am trying to separate revision numbers (60.0.1, 20.0b5) from
> extraneous directories (latest-esr, 20.0.1-funnelcake22)
>
> You can see a full list before I have at it here:
>
> https://ftp.mozilla.org/pub/firefox/releases/
>
> I just want current releases
>


--=20
JJ

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

<div dir=3D"ltr"><div>Maybe this will work</div><div><br></div><div>use HTT=
P::UserAgent;<br><br>my $ua =3D HTTP::UserAgent.new;<br>$ua.timeout =3D 10;=
<br><br>my $response =3D $ua.get(&quot;<a href=3D"https://ftp.mozilla.org/p=
ub/firefox/releases/">https://ftp.mozilla.org/pub/firefox/releases/</a>&quo=
t;);<br><br>if $response.is-success {<br>=C2=A0=C2=A0=C2=A0 say $response.c=
ontent ~~ m:g{\&gt; (\d+ \. .+?) \/};<br>} <br></div><div>..</div><div><br>=
</div><div>Please post also your question to StackOverflow, you might have =
better answers there. This one works directly on the HTML source, but you w=
ill just need to take out \&gt; and \/ to use other. Also it&#39;s a global=
 one, if you work by lines it might be simpler.<br></div></div><br><div cla=
ss=3D"gmail_quote"><div dir=3D"ltr">El lun., 14 may. 2018 a las 11:21, Todd=
AndMargo (&lt;<a href=3D"mailto:ToddAndMargo@zoho.com">ToddAndMargo@zoho.co=
m</a>&gt;) escribi=C3=B3:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&gt;&gt;=
 El lun., 14 may. 2018 a las 7:08, ToddAndMargo (&lt;<a href=3D"mailto:Todd=
AndMargo@zoho.com" target=3D"_blank">ToddAndMargo@zoho.com</a> <br>
&gt;&gt; &lt;mailto:<a href=3D"mailto:ToddAndMargo@zoho.com" target=3D"_bla=
nk">ToddAndMargo@zoho.com</a>&gt;&gt;) escribi=C3=B3:<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0On 05/13/2018 09:41 PM, ToddAndMargo wrote:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Hi All,<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; I can&#39;t not remember what I did in Pe=
rl 5 here and<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; am not having a good time converting it t=
o Perl 6.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $=C2=A0 perl -e &#39;my $A=3D&quot;44.rc0=
&quot;; if ($A ~~ /(^[0-9,.,a,b,rc]+$)/ ) {print<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; &quot;$1\n&quot;;} else {print &quot;\$A =
=3D &lt;$A&gt;\n&quot;}&#39;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; 44.rc0<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; The actual code is:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; if ( $Line2 ~~ /(^[0-9,.]+$)/ ) { push ( =
@WebVersions, $Line2 ); }<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; The actual data looks like:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D 6.0.1<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D 6.0.2<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D 6.0<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D 6.0b1<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D 6.0b2<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D 6.0b3<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D 6.0b4<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D 6.0b5<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D 60.0<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D 60.0b10<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D 60.0b11<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D 60.0b12<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; I am trying to exclude things that look l=
ike:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D bonecho<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D custom-updates<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D deerpark<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D devpreview<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D granparadiso<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D latest-beta<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $Line2 =3D latest-esr<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Many thanks,<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 &gt; -T<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0<a href=3D"http://perl6.org" rel=3D"noreferrer"=
 target=3D"_blank">perl6.org</a> &lt;<a href=3D"http://perl6.org" rel=3D"no=
referrer" target=3D"_blank">http://perl6.org</a>&gt; is down by the way.<br=
>
&gt;&gt; <br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0Is this right?<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0perl6 -e &#39;my $A=3D&quot;44.rc20&quot;; if $=
A ~~ m/( \d**1..4 &quot;.&quot; ( &quot;a&quot; | &quot;b&quot; | &quot;rc&=
quot;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0) .*$ ) /=C2=A0 {say &quot;$0&quot;;} else {say=
 &quot;no match&quot;;}&#39;<br>
&gt;&gt; <br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A044.rc20<br>
&gt;&gt; <br>
<br>
On 05/13/2018 11:41 PM, JJ Merelo wrote:<br>
&gt; You want to exclude lines starting with an alphabetic character, or <b=
r>
&gt; which are composed exclusively by alphabetic characters?<br>
&gt;<br>
<br>
<br>
I am trying to separate revision numbers (60.0.1, 20.0b5) from<br>
extraneous directories (latest-esr, 20.0.1-funnelcake22)<br>
<br>
You can see a full list before I have at it here:<br>
<br>
<a href=3D"https://ftp.mozilla.org/pub/firefox/releases/" rel=3D"noreferrer=
" target=3D"_blank">https://ftp.mozilla.org/pub/firefox/releases/</a><br>
<br>
I just want current releases<br>
</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature" data-smartmail=3D"gmail_signature">JJ</div>

--00000000000000abae056c274e5b--
0
jjmerelo
5/14/2018 9:42:22 AM
Hi Todd,

On Sun, 13 May 2018 22:07:59 -0700
ToddAndMargo <ToddAndMargo@zoho.com> wrote:

> On 05/13/2018 09:41 PM, ToddAndMargo wrote:
> > Hi All,
> >=20
> > I can't not remember what I did in Perl 5 here and
> > am not having a good time converting it to Perl 6.
> >=20
> > $=C2=A0 perl -e 'my $A=3D"44.rc0"; if ($A ~~ /(^[0-9,.,a,b,rc]+$)/ ) {p=
rint=20
> > "$1\n";} else {print "\$A =3D <$A>\n"}'
> >=20
> > 44.rc0
> >=20
> > The actual code is:
> > if ( $Line2 ~~ /(^[0-9,.]+$)/ ) { push ( @WebVersions, $Line2 ); }
> >=20
> > The actual data looks like:
> >=20
> > $Line2 =3D 6.0.1
> > $Line2 =3D 6.0.2
> > $Line2 =3D 6.0
> > $Line2 =3D 6.0b1
> > $Line2 =3D 6.0b2
> > $Line2 =3D 6.0b3
> > $Line2 =3D 6.0b4
> > $Line2 =3D 6.0b5
> > $Line2 =3D 60.0
> > $Line2 =3D 60.0b10
> > $Line2 =3D 60.0b11
> > $Line2 =3D 60.0b12
> >=20
> > I am trying to exclude things that look like:
> >=20
> > $Line2 =3D bonecho
> > $Line2 =3D custom-updates
> > $Line2 =3D deerpark
> > $Line2 =3D devpreview
> > $Line2 =3D granparadiso
> > $Line2 =3D latest-beta
> > $Line2 =3D latest-esr
> >=20
> >=20
> > Many thanks,
> > -T =20
>=20
> perl6.org is down by the way.
>=20

https://docs.perl6.org/type.html and https://perl6.org/ seem fine from here=
 now
- please try again.

> Is this right?
>=20
> perl6 -e 'my $A=3D"44.rc20"; if $A ~~ m/( \d**1..4 "." ( "a" | "b" | "rc"=
=20
> ) .*$ ) /  {say "$0";} else {say "no match";}'
>=20
> 44.rc20
>=20
>=20
>=20



--=20
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Best Introductory Programming Language - http://shlom.in/intro-lang

*Harry*: Yes, it is obvious that this pig is the most beautiful person for
miles.
*Miss Piggy*: Indeed. Candice Swanepoel ain=E2=80=99t got nothing on=E2=80=
=A6 Moi!
    =E2=80=94 http://is.gd/zsmond

Please reply to list if it's a mailing list post - http://shlom.in/reply .
0
shlomif
5/14/2018 12:24:28 PM
On 05/14/2018 02:42 AM, JJ Merelo wrote:
> Maybe this will work
>=20
> use HTTP::UserAgent;
>=20
> my $ua =3D HTTP::UserAgent.new;
> $ua.timeout =3D 10;
>=20
> my $response =3D $ua.get("https://ftp.mozilla.org/pub/firefox/releases/=
");
>=20
> if $response.is-success {
>  =C2=A0=C2=A0=C2=A0 say $response.content ~~ m:g{\> (\d+ \. .+?) \/};
> }

Hi JJ,

Thank you for the regex!  There are 1001 way to do things
in Perl!

I tested HTTP::UserAgent months ago.  I don't remember exactly
what did not work right, but I wound up writing myself
a module to interface with "curl", where there are no issues
with redirects, user agent stings, cookies, and such.

My curl module also allows me to send eMail, including SSL
and one attachment.

The one drawback of Perl 6 over Perl 5 is the lack of
mature module support, but things are always improving!

:-)

-T
0
ToddAndMargo
5/15/2018 6:43:25 AM
--00000000000053da44056c38f408
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

As far as I understand it, HTTP::UserAgent is preferred over LWP::Simple.
It does work to spec now, so I'm using it...

El mar., 15 may. 2018 a las 8:44, ToddAndMargo (<ToddAndMargo@zoho.com>)
escribi=C3=B3:

> On 05/14/2018 02:42 AM, JJ Merelo wrote:
> > Maybe this will work
> >
> > use HTTP::UserAgent;
> >
> > my $ua =3D HTTP::UserAgent.new;
> > $ua.timeout =3D 10;
> >
> > my $response =3D $ua.get("https://ftp.mozilla.org/pub/firefox/releases/=
");
> >
> > if $response.is-success {
> >      say $response.content ~~ m:g{\> (\d+ \. .+?) \/};
> > }
>
> Hi JJ,
>
> Thank you for the regex!  There are 1001 way to do things
> in Perl!
>
> I tested HTTP::UserAgent months ago.  I don't remember exactly
> what did not work right, but I wound up writing myself
> a module to interface with "curl", where there are no issues
> with redirects, user agent stings, cookies, and such.
>
> My curl module also allows me to send eMail, including SSL
> and one attachment.
>
> The one drawback of Perl 6 over Perl 5 is the lack of
> mature module support, but things are always improving!
>
> :-)
>
> -T
>


--=20
JJ

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

<div dir=3D"ltr">As far as I understand it, HTTP::UserAgent is preferred ov=
er LWP::Simple. It does work to spec now, so I&#39;m using it...<br></div><=
br><div class=3D"gmail_quote"><div dir=3D"ltr">El mar., 15 may. 2018 a las =
8:44, ToddAndMargo (&lt;<a href=3D"mailto:ToddAndMargo@zoho.com">ToddAndMar=
go@zoho.com</a>&gt;) escribi=C3=B3:<br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
>On 05/14/2018 02:42 AM, JJ Merelo wrote:<br>
&gt; Maybe this will work<br>
&gt; <br>
&gt; use HTTP::UserAgent;<br>
&gt; <br>
&gt; my $ua =3D HTTP::UserAgent.new;<br>
&gt; $ua.timeout =3D 10;<br>
&gt; <br>
&gt; my $response =3D $ua.get(&quot;<a href=3D"https://ftp.mozilla.org/pub/=
firefox/releases/" rel=3D"noreferrer" target=3D"_blank">https://ftp.mozilla=
..org/pub/firefox/releases/</a>&quot;);<br>
&gt; <br>
&gt; if $response.is-success {<br>
&gt;=C2=A0 =C2=A0=C2=A0=C2=A0 say $response.content ~~ m:g{\&gt; (\d+ \. .+=
?) \/};<br>
&gt; }<br>
<br>
Hi JJ,<br>
<br>
Thank you for the regex!=C2=A0 There are 1001 way to do things<br>
in Perl!<br>
<br>
I tested HTTP::UserAgent months ago.=C2=A0 I don&#39;t remember exactly<br>
what did not work right, but I wound up writing myself<br>
a module to interface with &quot;curl&quot;, where there are no issues<br>
with redirects, user agent stings, cookies, and such.<br>
<br>
My curl module also allows me to send eMail, including SSL<br>
and one attachment.<br>
<br>
The one drawback of Perl 6 over Perl 5 is the lack of<br>
mature module support, but things are always improving!<br>
<br>
:-)<br>
<br>
-T<br>
</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature" data-smartmail=3D"gmail_signature">JJ</div>

--00000000000053da44056c38f408--
0
jjmerelo
5/15/2018 6:45:46 AM
Reply: