in reply to Problem in IO::Socket syntax?

The only thing I can say is that while there are a few things that I would do differently and that there's a small typo on line 40, your code works for me. Are you absolutely sure that you can access the telnet port on that machine that you're accessing?

Replies are listed 'Best First'.
Re: Re: Problem in IO::Socket syntax?
by c (Hermit) on Mar 31, 2002 at 00:16 UTC
    telnet is not enabled on the host i am testing on, so the output of telnet failing isnt what throws me. i dont see where the error complaining about the concatenation is coming from however.

    thanks -c

      Oh.

      I understand that you were probably frustrated not know where on earth the word "concatnation" would come out of your code, but you didn't say that that was your problem. Wouldn't you agree it's really hard to tell what you were asking? ;)

      Anyway, I think Ryszard got the answer correctly... basically, embedding variables in string implicitly invokes the concat op, so your line 40 is equivalent of:

      print $host . " FAILEd to repond on " . $service . " " . $ports{ se +rvice } . "\n";

      So you see that if $port{ service } was undefined, you would get a concatnation warning. If you're interested, check out the output of perl -MO=Terse yourscript.pl