Odd word problem: Difference between revisions

Content added Content deleted
(→‎{{header|Perl}}: added threads version)
(→‎{{header|Perl}}: comment edit)
Line 760: Line 760:


=={{header|Perl}}==
=={{header|Perl}}==
Both versions process text until EOF, not dot.
All versions process text until EOF, not dot.


Input:
Input:
Line 816: Line 816:
}</lang>
}</lang>
===Threads (processes) version===
===Threads (processes) version===
Perl still has weak threads support. It's far more safe yet portable to use processes (fork).
Perl still has weak threads support. Far more safe yet portable is to use processes (fork).


Here, fork is used instead of threads and pipe is used instead of conditional variable.
Here, fork is used instead of threads and pipe is used instead of conditional variable.