Hi guys. I'm very new to Perl. Making the switch from Python (cringe). The reason is because Perl seems to have much better regex capabilities than Python does and I need to really get started on this data extraction script my boss wants. However, I am finding it hard to do something that should be extremely simple. All I want to do is have the script open a simple text file, read it and as its reading do pattern matching. I can't seem to get it to open, read, and scan though. This was quite simple in (gulp) Python...please help
$file = open(INFILE, 'document.txt') or die;
if($file =~ /[+|-]user ID/)
{print "found User ID"}
else
{print "User ID not found"
Just something as simple as that...the code runs (using Perl Express IDE nice prog by the way) but it always returns false but I know for a fact that the pattern is a working pattern and I know that there are user id's in the text file. Any help is appreciated.
$file = open(INFILE, 'document.txt') or die;
if($file =~ /[+|-]user ID/)
{print "found User ID"}
else
{print "User ID not found"
Just something as simple as that...the code runs (using Perl Express IDE nice prog by the way) but it always returns false but I know for a fact that the pattern is a working pattern and I know that there are user id's in the text file. Any help is appreciated.