Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Problem in IO::Socket syntax?

by lestrrat (Deacon)
on Mar 30, 2002 at 22:52 UTC ( [id://155518]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://155518]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-25 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found