Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: tracing system calls a perl script is making

by gideondsouza (Pilgrim)
on May 31, 2013 at 17:30 UTC ( [id://1036274]=note: print w/replies, xml ) Need Help??


in reply to Re: tracing system calls a perl script is making
in thread tracing system calls a perl script is making

That was a really eloquent solution!

Unfortunately I think my reading stdout with pipes is flawed! :( I get all the "starting" "hello" and "ending code" just all together after all the 367 system calls and printed.

And this is because I'm reading the pipes after the program exits

Any ideas for other approaches?

Thanks for your answer though! After 1 month of side lining this I realize today my approach is slightly flawed!

  • Comment on Re^2: tracing system calls a perl script is making

Replies are listed 'Best First'.
Re^3: tracing system calls a perl script is making
by shmem (Chancellor) on May 31, 2013 at 17:56 UTC
    Unfortunately I think my reading stdout with pipes is flawed!

    Not necessarily so. More probably you are "suffering from buffering":

    • printing to the terminal is line buffered
    • printing elsewhere is block buffered

    Try inserting

    $| = 1;

    at the top of your program. See perlvar.

Re^3: tracing system calls a perl script is making
by BrowserUk (Patriarch) on May 31, 2013 at 18:49 UTC
    I get all the "starting" "hello" and "ending code" just all together after all the 367 system calls and printed.

    Replace print with print STDERR ...; (or use warn).


    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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 20:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found