|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re: Question regarding exact regexp matchingby jethro (Monsignor) |
| on Jun 28, 2012 at 22:15 UTC ( #979013=note: print w/ replies, xml ) | Need Help?? |
|
You try to assign a hash to a scalar. A hash in scalar context will return a string that tells you something about the fill ratio of your hash. Try it out:
You want this instead:
As you can see, now you are assigning a hash to a hash. PS: It helps with debugging to print out values of variables even when you think you know what is in there. Very helpful for this is Data::Dumper. Try the following before and after your logging loop and see what your data looks like (you also have to add "use Data::Dumper" at the start of your script):
Also very helpful to print out whatever gets matched in your logging loop, i.e. put this inside the match-success if-case:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||