in reply to Format with Args at End of Script

Re-updated with even fewer typos!

You could store the format in a string like thus:

use vars qw( %format ); BEGIN { $format{GRID} = <<'FMT1'; format GRID = -------------------------------------------------------- @>>>: @<<<<<<<<<<<<<<<<<<< | @<<<<<<<<<<<<<<<<<<< $prefix_text, $left_text, $right_text -------------------------------------------------------- . FMT1 } #look ma, three different block closing methods all #in a column down the left side, yay!

using the local variable names you prefer and putting the format all the way at the bottom as you prefer. You do wind up with one global format storing hash but oh well.

Then when in scope with the variables you are using in the format you do this:

eval $format{GRID}; die "Oops eval wasn't happy with $format{GRID},\n$@" if $@;

Lordy it's scary stuff and if you have to eval inside a loop it will suck more but it gets what you want and is sort recommended in the Camel2 on pg. 126-7.

--
$you = new YOU;
honk() if $you->love(perl)