Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: A mystery?

by BrowserUk (Pope)
on Jul 15, 2013 at 23:34 UTC ( #1044481=note: print w/replies, xml ) Need Help??


in reply to Re: A mystery?
in thread A mystery?

Interesting that it dies under Linux with empty $!

I've no knowledge to address that.

The only possibility that springs to mind is that *nix sysread really objects to being used on a filehandle that has previously been used in "formatted IO" mode.

Ie. As the DATA pseudo-handle is actually the same handle used to read the source, which presumably reads it using formatted IO, trying to read it with low-level IO sysread() causes it to throw its hands up in disgust :)

even if I replace CRLF with LF.

sysread should be completely oblivious to CRLF/LF -- even if I was asking it to read one or more -- but I'm asking it to read 80 characters only, so there are no newlines (of any flavour) being read.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^3: A mystery?
by Perlbotics (Canon) on Jul 16, 2013 at 08:47 UTC

    Works for me (Linux) if I prepend sysread() with

    binmode( DATA );

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1044481]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2016-12-11 02:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (168 votes). Check out past polls.