Try taking away the "+" in your filehandle line, so that it reads:
open
(WRITE,">/Users/dave/Documents/Programming/Perl/081008mathables/add.txt");
No, that didn't work. Program changed to:
#!/usr/bin/perl -w
use strict;
my $answer;
open(WRITE,">/Users/dave/Documents/Programming/Perl/081008mathtables/add.txt")
for ($a = 1; $a <= 100; $a++)
{
for ($b = 1; $b <= 100; $b++)
{
$answer = ($a-$b);
print WRITE "$a - $b\t$answer\n";
}
}
close(WRITE);
Output:
syntax error at
/Users/dave/Documents/Programming/Perl/081008mathtables/index.pl line
6, near "1;"
syntax error at
/Users/dave/Documents/Programming/Perl/081008mathtables/index.pl line
7, near "++)
"
syntax error at
/Users/dave/Documents/Programming/Perl/081008mathtables/index.pl line
9, near "++)
"
syntax error at
/Users/dave/Documents/Programming/Perl/081008mathtables/index.pl line
13, near "}"
Execution of
/Users/dave/Documents/Programming/Perl/081008mathtables/index.pl
aborted due to compilation errors.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/