Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^6: STDERR going to string

by salva (Abbot)
on Oct 12, 2011 at 07:43 UTC ( #930926=note: print w/replies, xml ) Need Help??

in reply to Re^5: STDERR going to string
in thread STDERR going to string

But then, why after redirecting STDERR, fileno(STDERR) is still 2? is it cheating?

And why the Inline::C does example does not work even when the perlio.h redefines C stderr to point to some variable inside the perl runtime?

Replies are listed 'Best First'.
Re^7: STDERR going to string
by BrowserUk (Pope) on Feb 17, 2012 at 07:29 UTC

    The source of the problem *is* perlIO. Not the underlying Windows CRT calls. With the PerlIO #defines in place, you cannot even do:

    fprintf( stderr, ... );

    Without perl crashing in a heap around your ears.

    However, if in your XS code, you #undef stderr to bypass the ridiculous PerlIO redefinitions, things begin to work. But you also have to defeat all the other pointless PerlIO redefinitions.

    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.

    The start of some sanity?

Re^7: STDERR going to string
by Anonymous Monk on Oct 12, 2011 at 08:35 UTC


    How about you tell me?

    If I were curious I would ask perl5-porters :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://930926]
[choroba]: Well, merging two hashes recursivelly is not that hard either, but...
[Corion]: choroba: Yeah - I think I used (and extended) Hash::Merge for recursive merging
[Corion]: I still wonder if I should maybe publish Config::Collect, which (I think) is the dumb hash merger
[Corion]: It still needs some more ways of specifying defaults (in memory) and loading files (user-supplied loader(s)/ callbacks?), and the app-specific parts ripped out...
[Corion]: Also, the Config::Spec part(s) need more work to document how to pass in things from a data structure and from %ENV (or any other hash)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2018-02-23 19:28 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (310 votes). Check out past polls.