#!/usr/bin/perl use IO::File; $stuff="0.4312342134234234"; $morestuff="0.2432134234342342"; $fh=IO::File->new(">/tmp/foo2.txt"); $fh=sprintf($fh <<"__EOFOO__", $stuff, $morestuff); Some stuff: %.4f Some more stuff %.4f __EOFOO__ #### Missing comma after first argument to sprintf function at test.pl line 12, near "$morestuff)" (Might be a runaway multi-line << string starting on line 9) Execution of test.pl aborted due to compilation errors.