At 08:41 PM 7/4/01 -0500, RL Autry wrote:
A friend of mine sent me a file to write
to help get me started on programming Perl.
So I did (in notepad):
#!/usr/bin/perl -w
use strict;
while () {
if ( /book/i or /bk/i) {
print;
}
When I run it in my dos window --
I get an error message that says:
Missing right curly or square bracket at findit.pl line 6, at end of line
syntax error at findit.pl line 6, at EOF
Execution of findit.pl aborted due to compilation errors.
Do I need to compile this file before I use it?
No.
I thought perl was a self-compiling language.
More or less.
What is it looking for?
Believe it or not, the missing right curly or square bracket at line 6. If
you indent your code, you'll find it easier to see where one's missing:
#!/usr/bin/perl -w
use strict;
while () {
if ( /book/i or /bk/i ) {
print
}
Anything look unbalanced about that?