in reply to Regex and array
Are you sure that the match part won't work? Have you checked that you can open your file and read the lines you expect?
Adding the line
use strict;
to the top of your script will make Perl tell you what it sees. Then you will find that what you see is not what Perl sees.
You should always guard your calls to open with an or die like this:
open my $file, $filename or die "Couldn't open '$filename': $!";
That way, you prevent your program from running when it can't read a file and you even get an informative error message.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex and array
by Deus Ex (Scribe) on May 25, 2010 at 12:34 UTC | |
by toolic (Bishop) on May 25, 2010 at 12:47 UTC | |
by Deus Ex (Scribe) on May 25, 2010 at 13:07 UTC | |
by Corion (Patriarch) on May 25, 2010 at 12:41 UTC | |
by Deus Ex (Scribe) on May 25, 2010 at 12:56 UTC | |
by vtheron (Novice) on May 25, 2010 at 21:38 UTC | |
by Deus Ex (Scribe) on May 26, 2010 at 09:50 UTC |