use Tk; use strict "vars"; sub write_report() { my ($xml_drawing, $xml_machine, $xml_material, $xml_date, $xml_nest_type, $xml_mcy_text, $xml_pile, $xml_tn, $date_use); my ($summary_file, $res_open_summary_file); $summary_file = ">c:\\temp\\summary_file.txt"; $xml_drawing = "Pilot XX1"; $xml_machine = "Bruning"; $xml_material = "steel"; $xml_date = "12/01/2015"; $xml_nest_type = "Open"; $xml_mcy_text = "Test text"; $xml_pile = "Py 1234"; $xml_tn = "TS12"; $date_use = "16 Jan 2015"; $res_open_summary_file = open(SUMMOP, $summary_file); print "open file result <$res_open_summary_file>\n"; format_name SUMMOP "HEAD1B"; write SUMMOP; close(SUMMOP); format HEAD1B = DATE: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $date_use GAME NAME @<<<<<<<<<<<<<<<< $xml_drawing MACHINE MATERIAL DATE REQ --------- ---------- ----------- @||||||||||||||||||||||||||||||||| @||||||||||||||||||||||||||| @||||||||| $xml_machine $xml_material $xml_date @||||||||||||||| $xml_nest_type (FULL PLATE) (STORED IN PILE @||||||||||||) (TEST NO. @||||||||) $xml_pile $xml_tn @||||||||||||||||||||||||||||| $xml_mcy_text . } write_report(); print "\nafter call to write_report - perl version $]\n";