in reply to why dosn't my code work?

== is for comparing numbers, eq is for comparing strings. See perlop.

(And in general it's helpful to tell us in what way your code "doesn't work").

Replies are listed 'Best First'.
Re^2: why dosn't my code work?
by tweetiepooh (Hermit) on Apr 21, 2009 at 09:45 UTC
    Additionally comparing to a fixed text need that value in quotes
    if ($value eq "string")
      While it is correct that one should quote strings, it's by no means required (unless one uses strict, which again is highly recommended).
      $ perl -E 'if (foo eq "foo") { say STDOUT yes } ' yes

      I really don't recommend it, but it does work without quotes.