in reply to Re: Getting rid of extra outputs
in thread Getting rid of extra outputs

No I don't call it like that.

It is a.so file that is called by a.pm module that is provided. I call the external.pm and it calls the external.so file.

When I run it via command line I get things like buffering 10000... and then after the results will be returned. I have a feeling that when I do a use external, it makes those statements. Is there a work around w/o having to edit external.pm? I don't want to mess about with another persons script.

Replies are listed 'Best First'.
Re^3: Getting rid of extra outputs
by muntfish (Chaplain) on May 27, 2005 at 11:02 UTC

    Seems like you want to temporarily redirect STDOUT to somewhere else?

    You'll find lots of good stuff if you Super Search here for "redirect stdout" or similar.

    This is a VERY basic way of doing it, which might get you started:

    print "This goes to stdout\n"; { local *STDOUT; open STDOUT, '>/tmp/myoutput'; print "This gets redirected\n"; # more code here that prints stuff to stdout } print "Back to normal stdout\n";

    If you really don't need the output of your external.pm then change /tmp/myoutput to /dev/null (if you're on Unix).

    Disclaimer: I've never actually used techniques like this in real code, there may be problems/caveats etc. Searching this site should turn up more robust solutions!


    s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$&