View Single Post
Old Jun 6th, 2008, 6:37 PM   #2
Mocker
Hobbyist Programmer
 
Mocker's Avatar
 
Join Date: Oct 2005
Location: Indiana
Posts: 219
Rep Power: 0 Mocker is an unknown quantity at this point
Send a message via AIM to Mocker
Re: Perl Noob, regex

What are you trying to match, and what is your script showing?

I see a couple issues to note..

print '\nA match was found\n';
should be
print "\nA match was found\n";

also, the code $text = <search>; only reads the first line of the file.
If you want to look for a match on any line in the file, you have to put that in a loop to check each line.
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi
freelance scripts - http://ryanguthrie.com/index.html
Mocker is offline   Reply With Quote