rakzer has asked for the wisdom of the Perl Monks concerning the following question:
$stuff="0.4312342134234234"; $morestuff="0.2432134234342342"; open(F,'>'.'/tmp/foo1.txt'); printf(F << "__EOFOO__", $stuff, $morestuff); Some stuff: %.4f Some more stuff %.4f __EOFOO__ close(F);
and the same with a IO::File handle wont:
I'm trying to avoid having to detour over sprintf then use a normal print.$stuff="0.4312342134234234"; $morestuff="0.2432134234342342"; $fh=IO::File->new(">/tmp/foo2.txt"); printf($fh << "__EOFOO__", $stuff, $morestuff); Some stuff: %.4f Some more stuff %.4f __EOFOO__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IO::File handle and printf
by ambrus (Abbot) on Nov 03, 2010 at 13:56 UTC | |
|
Re: IO::File handle and printf
by kcott (Archbishop) on Nov 03, 2010 at 14:58 UTC | |
|
Re: IO::File handle and printf
by Anonymous Monk on Nov 03, 2010 at 13:51 UTC | |
by rakzer (Novice) on Nov 03, 2010 at 13:57 UTC | |
by Anonymous Monk on Nov 03, 2010 at 14:02 UTC | |
by rakzer (Novice) on Nov 03, 2010 at 14:05 UTC | |
by ikegami (Patriarch) on Nov 03, 2010 at 20:45 UTC | |
by Anonymous Monk on Nov 03, 2010 at 14:13 UTC |