<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
Dave, <br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
Thanks for the suggestion on MCE. I'll read about it this weekend. To answer your other question. Essentially my Perl program is logging into a web application and running a utility that calls back to the system that the Perl script is running from. I was hoping
 to have the Perl program 'catch' call back or perhaps launch a thread or something that can listen for the call back. My terminology may be off so apologies in advance still learning! I hope this gets the idea/concept across though?<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
Mark,<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
Thanks for the Raku articles too. I'll take <span id="ms-outlook-android-cursor">
</span>a look at them for my edification. At the moment, I'm really trying to focus on getting better at Perl 5 as work currently relies on it fairly heavily. Really need to look into Raku though just to be more versed on the differences between the two languages.<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
Rob <br>
<br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Mark Senn <mark@purdue.edu><br>
<b>Sent:</b> Thursday, October 22, 2020 11:07:38 AM<br>
<b>To:</b> Turner, Howard Robert <turne349@purdue.edu><br>
<b>Cc:</b> perl@ecn.purdue.edu <perl@ecn.purdue.edu>; Purdue Perl Mongers <purdue-pm@pm.org><br>
<b>Subject:</b> Re: [Purdue-pm] Threads and forks</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Rob Turner <turne349@purdue.edu> wrote on 2020-10-22 at 01:10+00:<br>
|  Greetings again everyone.<br>
|  <br>
|  Looking for some advice. I'm writing a small program that talks to a<br>
|  webserver and ends waiting for a connection back from the<br>
|  webserver. Problem is I can only figure out to have the call back<br>
|  handled or my Perl program continue processing but not both.<br>
|  <br>
|  Started reading the Perl threads tutorial but it suggests not using<br>
|  threads and then started reading about fork instead. So a little<br>
|  overwhelmed in figuring out which one is "the right way".<br>
|  <br>
|  Anyone have suggestions and/or tutorials they'd suggest reviewing beyond<br>
|  the ones on perldoc?<br>
|  <br>
|  Respectfully,<br>
|  Rob<br>
<br>
Rob,<br>
<br>
I like Raku (formerly known as Perl 6) better than Perl 5.  Raku is harder to<br>
learn than Perl 5 because it is much more powerful.  Fewer people know<br>
Raku than Perl 5.  Raku is not installed on as many computers.  My return<br>
on investment learning Raku has been excellent.<br>
<br>
If you'd like to make the jump to Raku this quote<br>
    Raku is designed to support parallelism, asynchronicity and concurrency.<br>
is from<br>
    <a href="https://docs.raku.org/language/concurrency">https://docs.raku.org/language/concurrency</a><br>
<br>
I'm guessing you want to go async because you're sending requests to<br>
multiple webservers and/or sending a message to a single web server<br>
that will require lots of computation.  Is that correct?<br>
<br>
See<br>
    <a href="https://zostay.com/posts/2019/12/01/introducing-async-concurrency-in-raku/">
https://zostay.com/posts/2019/12/01/introducing-async-concurrency-in-raku/</a><br>
for around 20 other async/concurrency articles.<br>
<br>
See<br>
    <a href="https://cro.services">https://cro.services</a><br>
for information on Cro.  From the web page:<br>
    Cro is a set of libraries for building reactive distributed systems,<br>
    lovingly crafted to take advantage of all Raku (formerly Perl 6) has to<br>
    offer. The high level APIs make the easy things easy, and the<br>
    asynchronous pipeline concept at Cro's heart makes the hard things<br>
    possible.<br>
<br>
<a href="https://raku.guide/">https://raku.guide/</a> is a good intro to Raku.  Raku is Object-Oriented,<br>
OO stuff is built in on Raku, bolted on in Perl 5.  From the web page<br>
    my @final-array = reverse(sort(unique(@array)));<br>
is easier to read in my opinion in Raku<br>
    my @final-array = @array.unique.sort.reverse;<br>
Raku has more functions, more operations, more flexibility.<br>
<br>
Await may do what you want see<br>
    <a href="https://docs.raku.org/routine/await">https://docs.raku.org/routine/await</a><br>
but using Cro may be cleaner.    <br>
<br>
Raku does not have modules that help write PDF files as far as I know.<br>
Perl 5 has way more modules.  If you need a module that Perl 5 does<br>
not have but Raku does and you don't want to write it you'll want to<br>
use Perl 5.   But, I can do most my work with Raku and love it.<br>
Raku is written in Raku using a Raku "grammar".  Raku regexes are more<br>
powerful than Perl 5 regular expressions.  Raku has "infinite" precision<br>
arithmetic built in for integers and rational numbers.<br>
<br>
-mark<br>
</div>
</span></font></div>
</body>
</html>