Thank you, everyone who helped me. I greatly appreciate this.
-David
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On Thu, 2008-10-09 at 19:31 -0400, David wrote:
> However, when I insert some code to write to a file it fails an odd death:
>
> #!/usr/bin/perl -w
> use strict;
use warnings;
# This is preferred over the -w in the shebang line
# use diagnostics;
# This may replace warnings and gives a long expla
David wrote:
My simple program works well in the terminal window:
#!/usr/bin/perl -w
use strict;
my $answer;
for ($a = 1; $a <= 100; $a++)
{
for ($b = 1; $b <= 100; $b++)
{
$answer = ($a-$b);
print "$a - $b\t$answer\n";
}
}
Output:
1 - 1 0
1 - 2 -1
1
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/081008ma
Try taking away the "+" in your filehandle line, so that it reads:
open
(WRITE,">/Users/dave/Documents/Programming/Perl/081008mathables/add.txt");
Dave
On Fri, 10 Oct 2008 09:31:02 +1000, David <[EMAIL PROTECTED]> wrote:
open(WRITE,"+>/Users/dave/Documents/Programming/Perl/081008mathtables
My simple program works well in the terminal window:
#!/usr/bin/perl -w
use strict;
my $answer;
for ($a = 1; $a <= 100; $a++)
{
for ($b = 1; $b <= 100; $b++)
{
$answer = ($a-$b);
print "$a - $b\t$answer\n";
}
}
Output:
1 - 1 0
1 - 2 -1
1 - 3 -2
1 -