The error is that @* from the format for page header looks in the subsequent line for the scalar it can represent and finds nothing but a dashed line so a little permutation can solve that. Move $PROJECT over the dashed line.
format PROJECT_TOP =
Project report for @* on (today)
$PROJECT
---------------------------
.
Why bichonfrise74 solution would not work, consider having added that line and see the output:
format STDOUT_TOP =
Project report for Mr. @* on (today)
---------------------------
$PROJECT_HEAD
.
format STDOUT =
@* @* @* @* @*
$DUE, $AT, $PRIORITY, $MSG, $CONTEXT
.
my $PROJECT_HEAD="NeilWatson";
write;
#OUTPUT
Project report for Mr. on (today)
---------------------------
$PROJECT_HEAD
As you could see @* read the empty line and hence showed empty value for the title and this served to silence perl from complaining. Now consider the output from the following code snippet:
format STDOUT_TOP =
Project report for Mr.@* on (today)
$PROJECT_HEAD
---------------------------------
.
format STDOUT =
@* @* @* @* @*
$DUE, $AT, $PRIORITY, $MSG, $CONTEXT
.
$PROJECT_HEAD="NeilWatson";
write;
#OUTPUT:
Project report for Mr.NeilWatson on (today)
---------------------------------
It'll be better if you removed the line numbers from the code segment in future posts, that makes it easier to get down to work with eliminating the need for having to manually remove the line numbers.
Excellence is an Endeavor of Persistence.
Chance Favors a Prepared Mind.
|