Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Hello mje,

You can use read as a temporary solution it does not give the warning, but it is not the same as sysread.

From the read documentation:

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.

I just tested with your code and the output looks ok:

$ 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

In comparison with sysread:

$ 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

Give it a try if it meets your criteria.

I tested on:

$ perl -v This is perl 5, version 24, subversion 1 (v5.24.1) built for x86_64-li +nux-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 ki +t. 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 Pa +ge.

Hope this helps, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!

In reply to Re^5: sysread() is deprecated on :utf8 handles by thanos1983
in thread sysread() is deprecated on :utf8 handles by mje

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (4)
    As of 2019-12-14 05:30 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?