in reply to Trying to make a search Part 2
Your first line:
#/usr/bin/perl
Should be:
#!/usr/bin/perl
This is an operating system thing, not a perl thing, and won't affect you if you are using a Windows system or calling the script from the command line (e.g. "perl myscript.pl")
Update: As many (sean, infoninja, and mdillon have pointed out, @data=<DATA> is correct.open(DATA, "data.txt") or die "error opening file $!"; @data = <DATA>;
Note that this is case-sensitive. You might want to use /$word/i to make it insenstive.if ($data =~ /$word/) {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Trying to make a search Part 2
by nuance (Hermit) on Jun 06, 2000 at 00:10 UTC |