in reply to Creating a Hash Syntax Error
The hashbang line is your problem; !#/usr/bin/perl should be #!/usr/bin/perl. The way you wrote it, "/usr/bin/perl" is interpreted as a comment, and the ! becomes an operator applied to the next line:
!%words = qw(...);
And obviously that's not valid Perl.
Since you're new to Perl, here's some general tips as well: format your script nice and readable, and use strict; and use warnings; to catch many common mistakes, typos and so on.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating a Hash Syntax Error
by ms238 (Initiate) on Jul 27, 2014 at 18:39 UTC |