i've problems with format an perl. so for e.g. i have a format in format.pl like this:
In my mainscript i have include this and do the output like this:format HEADER = Menge Art.nr. Bezeichnung Preis(€) Gesamt(€) _____________________________________________________________________ . format INHALT = @<<<< ^<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<< @>>>>>>>>> @>>>>>>>>> $menge,$nr,$text,$preis,$summe, ~~ ^<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<< $nr, $text . format FOOTER = _____________________________________________________________________ Warenwert: @>>>>>>>>> $gesamt .
So, what i want is to route the whole write() into a string (e.g. $output). i've found in perldoc a section to do this with the accumolator var ($^A) but i've now idea how to do this for my e.g.$~ = "HEADER"; write; $~ = "INHALT"; foreach (0..$#bestellung) { ($text, $nr, $preis, $menge) = split(/\|/, $bestellung[$_]); $summe = sprintf("%.2f", $menge*$preis); ... irgendwas ... write; } $~ = "FOOTER"; write;
Any ideas .. thx for you help!
ppm
In reply to How to route a format into a variable by ppm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |