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

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 making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2015-05-06 16:06 GMT
Find Nodes?
    Voting Booth?

    In my home, the TV remote control is ...

    Results (141 votes), past polls