Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: A Strange print() predicament.

by jasonk (Parson)
on Feb 19, 2003 at 21:41 UTC ( #236832=note: print w/ replies, xml ) Need Help??

in reply to A Strange print() predicament.

Making a copy of STDOUT that redirects the text that gets printed is one way, though there are probably better solutions than this...

#!/usr/bin/perl -w use strict; print "Print this\n"; { local *STDOUT; open(STDOUT,">/dev/null"); # don't allow this include file to print anything do ""; close(STDOUT) } print "Print this too\n";

Comment on Re: A Strange print() predicament.
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2015-11-27 00:49 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (710 votes), past polls