I consistently get a message like this printed to STDERR:j.pl some.file
where "nnn" turns out to be the actual size of the data file provided as a command-line arg.j.pl: got exactly nnn bytes from some.file
So what sort of message did it print to STDERR when you ran it? If the message was "got exactly nnnnn bytes from your.file", and your.file happens to have nnnnn bytes, then the read was successful, and you are simply having trouble viewing all the data -- that is, the problem is not in the perl script, but instead would be in your display tool, and in how that tool handles this data stream.
It could perhaps be something in the data file itself that is causing your display tool (terminal window? browser? something else?) to behave in some unexpected way -- e.g. some unexpected control byte is causing it to overwrite or otherwise erase/obliterate part of the data that is being given to it for display.
Consider looking for other ways to inspect the data so you can see what is going on. Redirect the perl script output to a file, edit that file with some trustworthy editor (emacs, vi, or somesuch), view it with some sort of hex-dump tool, etc.
If you ran the script as I posted it, then there should be no line breaks in the output -- just spaces. For fun, you could try changing that last line before the print statement; instead of this:
do this:s/\s+/ /g;
to put each non-space token on a separate line. If you have something like the gnu "less" (unix "more") for paging through a long file in a terminal window, that should convince you that the perl script is not losing any of the data.s/\s+/\n/g;
In reply to Re^3: string gets front truncated
by graff
in thread string gets front truncated
by hsfrey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |