in reply to Re^2: Comparing hash keys and values with Regular Expressions
in thread Comparing hash keys and values with Regular Expressions

CountZero

Ok, I admit I made a mistake when saying the output was the same.. Sorry 'bout that, but that's how we learn, right? After testing that piece of code again, with '=', I got the output I desired. But when tested with 'eq', I got the following message as well as an empty output:

Useless use of String eq in void context

I also got this error message for every single line of my code:

Use of uninitialized value in String eq

So what's that all about then? :s And how can I correct it by using 'eq' instead of '=' then?

Replies are listed 'Best First'.
Re^4: Comparing hash keys and values with Regular Expressions
by ww (Archbishop) on Jun 30, 2012 at 21:24 UTC
    Double-check your quotes (of both flavors, if applicable).
    Double-check parens, braces, brackets.
    Post (cut and paste) code so other sets of eyes can actually see possible causes.

    And re your breezy "Sorry 'bout that, but that's how we learn, right?:
    while learning from one's errors is a valuable approach, so too is reading the docs when some "wise one" tells you the case or usage is something different than you thought. [ Been there, took a while to learn to do that :-( ]

Re^4: Comparing hash keys and values with Regular Expressions
by Anonymous Monk on Jun 30, 2012 at 21:25 UTC

    ... So what's that all about then ...

    Its easier to point out if you post the new code

    use diagnostics; for more verbose messages