Hi Guys,

I am stuck in a problem and can't figure out what's going on.

What I am doing is this:

I have an array of ports that I need to connect to. For each port in this array I call a function ConnectToPort.

ConnectToPort function creates a socket, and if it successfully connects to the given port (which we have passed as argument) it adds the socket file handle into a text file along with the port number. Now when I read this socket file handle from the file and try to send something on that file handle, I get an error stating that Can't locate object method "send" via package "IO::socket::INET"

I am guessing that it is because when I wrote the socket file handle to a file, it is converted to string. (pardon me if this is really stupid. I am new to perl)

Any help would be greatly appreciated.

Thanks


In reply to Socket Handle not sending data ? by evilkamikaze

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.