note
thanos1983
<p>Hello [id://|mje],</p>
<p>You can use [https://perldoc.perl.org/functions/read.html|read] as a temporary solution it does not give the warning, but it is not the same as [http://perldoc.perl.org/functions/sysread.html|sysread].</p>
<p>From the [https://perldoc.perl.org/functions/read.html|read] documentation:</p>
<code>The call is implemented in terms of either Perl's or your system's native fread(3) library function. To get a true read(2) system call, see sysread.</code>
<p>I just tested with your code and the output looks ok:</p>
<code>
$ perl test.pl
child started
Cannot connect to child socket - Connection refused
Cannot connect to child socket - Connection refused
Cannot connect to child socket - Connection refused
connection from 127.0.0.1:33980
Child reading socket
shutdown 1
Child got /<element>Hello</element>/
connection from 127.0.0.1:33982
Child reading socket
Child EOF
Child reading socket
Child got /<element>Hello2</element>/
Child reading socket
Child EOF
shutdown 2
closing socket
Killing child
waiting on child
parent exiting
</code>
<p>In comparison with <code>sysread</code>:</p>
<code>
$ perl test.pl
child started
Cannot connect to child socket - Connection refused
Cannot connect to child socket - Connection refused
Cannot connect to child socket - Connection refused
connection from 127.0.0.1:33788
Child reading socket
sysread() is deprecated on :utf8 handles at test.pl line 108.
Child got /<element>Hello</element>/
connection from 127.0.0.1:33792
Child reading socket
sysread() is deprecated on :utf8 handles at test.pl line 108.
Child got /<element>Hello2</element>/
shutdown 1
Child reading socket
sysread() is deprecated on :utf8 handles at test.pl line 108.
Child EOF
Child reading socket
sysread() is deprecated on :utf8 handles at test.pl line 108.
Child EOF
shutdown 2
closing socket
Killing child
waiting on child
parent exiting
</code>
<p>Give it a try if it meets your criteria.</p>
<p>I tested on:</p>
<code>
$ perl -v
This is perl 5, version 24, subversion 1 (v5.24.1) built for x86_64-linux-gnu-thread-multi
(with 67 registered patches, see perl -V for more detail)
Copyright 1987-2017, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
</code>
<p>Hope this helps, BR.</p>
<code></code>
<div class="pmsig"><div class="pmsig-1069339">
Seeking for Perl wisdom...on the process of learning...not there...yet!
</div></div>
1195588
1195630