in reply to output from cgi
open (DAT, ">>yourData"); # note the >> print DAT $foo; close DAT; [download]
Update: Chris function not no caffeine well.. (ie remember to check the open call as mrbbking said)
Also take a look at This