Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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";

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://236832]
LanX will need to find a Perl workaround ... :-|
LanX leaving his cave to enjoy sun! *\o/*

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2017-03-30 15:17 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (360 votes). Check out past polls.