in reply to Matching text in a string

This: !=~ should be this: !~.

The condition is being seen as $text  !=  ~ m/$firstname/ && $type eq "login", which with warnings enabled would have produced:

!=~ should be !~ at ... Use of uninitialized value $_ in pattern match (m//) at ... Argument $text isn't numeric in numeric ne (!=) at ...

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Replies are listed 'Best First'.
Re^2: Matching text in a string
by hdb (Monsignor) on Apr 16, 2015 at 09:17 UTC

    It might well be that !=~ should be this: =~. See Corion's question re the logic.

    UPDATE: Forget it, I did not read the OP's question carefully enough...

      I think the OPs logic is clear; he just mixed up his operator. (His implementation may also be flawed!)


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
      In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
Re^2: Matching text in a string
by htmanning (Friar) on Apr 16, 2015 at 09:36 UTC
    Thanks! That's it.