May 19, 2010, 7:52 PM
Post #3 of 3
Re: [astro] Syntax error: word unexpected (expecting ")")
[In reply to]
1) Read the following about how to post code:
That is a requirement.
2) Start all your programs with the following lines:
use 5.010; #if using perl 5.10+
3) Declare all variables with my(), e.g.:
my($num1, $num2) = (3, 4);
4) Use the 3-arg form of open(), and use a variable instead of a bareword filehandle:
open my $INFILE, '<', 'data.txt'
or die "Couldn't open data.txt: $!";