M
Michiel
Hi. I am new to perl, working through the (so far excellent) book "Learning
Perl" by O'Reilly. So far so good, but now I run into smth I can't grasp.
When doing excercise 2 of chap.2, it won't compile, nomatter what I try.
Anyone see the error? I tried typing in the solution at the end of the book
and it gives the same error. The error is:
syntax error at ch2exc2.pl line 4, near "$COUNT("
Execution of ch2exc2.pl aborted due to compilation errors.
Here is the code:
#!perl
print "Enter seperate words, divided with (return):\n "; chomp(@INPUT =
<STDIN>);
foreach $WORD (@INPUT) {
$COUNT($WORD)++;
}
print %COUNT
Regards,
Michiel
Perl" by O'Reilly. So far so good, but now I run into smth I can't grasp.
When doing excercise 2 of chap.2, it won't compile, nomatter what I try.
Anyone see the error? I tried typing in the solution at the end of the book
and it gives the same error. The error is:
syntax error at ch2exc2.pl line 4, near "$COUNT("
Execution of ch2exc2.pl aborted due to compilation errors.
Here is the code:
#!perl
print "Enter seperate words, divided with (return):\n "; chomp(@INPUT =
<STDIN>);
foreach $WORD (@INPUT) {
$COUNT($WORD)++;
}
print %COUNT
Regards,
Michiel