jeanluca has asked for the wisdom of the Perl Monks concerning the following question:
Which doesn't work of course, perl now thinks $x contains a filename.#!/usr/bin/perl -l use strict; use warnings; my $x ; { local *STDOUT ; open STDOUT, ">$x" or die "nope\n"; print "this is stored in \$x" ; } print $x ;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Redirect STDOUT to a $variable
by Corion (Patriarch) on Aug 10, 2007 at 11:31 UTC | |
by Anonymous Monk on Feb 28, 2009 at 19:59 UTC | |
by Anonymous Monk on Jan 26, 2010 at 14:13 UTC | |
by iceman_san (Initiate) on Aug 10, 2007 at 13:19 UTC | |
by ysth (Canon) on Aug 10, 2007 at 23:53 UTC | |
Re: Redirect STDOUT to a $variable
by Moron (Curate) on Aug 10, 2007 at 11:53 UTC | |
Re: Redirect STDOUT to a $variable
by citromatik (Curate) on Aug 10, 2007 at 11:44 UTC | |
Re: Redirect STDOUT to a $variable
by bruceb3 (Pilgrim) on Aug 10, 2007 at 21:16 UTC | |
Re: Redirect STDOUT to a $variable
by Anonymous Monk on Nov 13, 2007 at 17:33 UTC |