in reply to Creating 2 sockets in a script.

Please, wrap you code into <c>...</c> tags.

You cannot use $s = "a" || $s = "b" (see perlop on precedence of operators), but you could use $s = "a" || "b" instead.