in reply to matching strings

Try
if ($a cmp $aa) ....
= -- assignment
== - numeric comparison
cmp string comparison

----
I Go Back to Sleep, Now.

OGB

Replies are listed 'Best First'.
Re^2: matching strings
by hardburn (Abbot) on Jun 16, 2004 at 16:12 UTC

    That's not what cmp is for. It's the string equvilent of <=> and is meant for use in sorting operations. In this case, it won't work at all as shown, because it returns 0 when the two strings are equal (unless( $a cmp $aa) would work, but there is a better way).

    What the OP really wants is eq.

    ----
    send money to your kernel via the boot loader.. This and more wisdom available from Markov Hardburn.