in reply to Writing to a file using Formats
format report_TOP=
You don't define the report filehandle yet. You should define it first.
$~="report";
$^="report_TOP";
$title = "Some Report";
You define these variables too late to use them.
($num1, $num2) = (/(\d+)/g) for ($_);
That should simply be:
( $num1, $num2 ) = /\d+/g;
sub add{
Your subroutine is called "add" but it also opens a file, increments two variables and queries the user for a yes/no answer and a pair of numbers. Either make the name more descriptive or reduce the functionality to match the name.
"START";
You have a string in void context which should generate a warning message. But if you are trying to jump to the START label you shouldn't try to do that from inside a subroutine.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Writing to a file using Formats
by bowei_99 (Friar) on Aug 02, 2009 at 08:00 UTC |