Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Killer byte tripping up Perl?

by Laurent_R (Canon)
on Dec 12, 2018 at 22:55 UTC ( [id://1227181]=note: print w/replies, xml ) Need Help??


in reply to Killer byte tripping up Perl?

Just a wild guess.

while (<CMD>)
reads data line by line assuming that it is a text file with lines separated by new line characters.

If your mycmd command is producing binary output, then you probably need to read the output as binary input. Maybe you should read blocks of bytes using the read command rather than the readline function or the equivalent <...> operator.

Also take a look at the binmode function (for input as well as for output).

Update: fixed the links above to that they lead directly to the relevant Perl documentation pages instead of a search page.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1227181]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-25 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found