Need help with checking string equalities - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Need help with checking string equalities

ok I am a beginner.. this is my first day of learning perl.. I want to know how to check for strings that are equal.. I tried using == but I guess thats is only for numeric values



here is the part hat i need help with

if ($content == $line)

{

print "duplicate";

}



any help would be greatly appreciated


Comments

  • Ah, now here's one I can answer! For strings you merely need to substitute "eq" for "==", so it would be....

    if ($content eq $line)



    Vimm





    : ok I am a beginner.. this is my first day of learning perl.. I want to know how to check for strings that are equal.. I tried using == but I guess thats is only for numeric values

    :

    : here is the part hat i need help with

    : if ($content == $line)

    : {

    : print "duplicate";

    : }

    :

    : any help would be greatly appreciated

    :






Sign In or Register to comment.