UPDATED from original post.

I tried you're simpler test script with $voice->talk, and it wouldn't even work without cgi. If you find the answer, let us know. I'm interested in learning about using sockets in modules, and there seems to be a trick to it, which eludes me. Like you it works from a conventional script. I did get it working from a simple procedural style module, but as soon as I put the $socket into a $self->{CONN} form, it gives a broken pipe. It has to be they way the socket gets stored in the scalar. Either a reference to the scalar needs to be used, or the socket needs to be stored as a full fledged hash? I just started reading my Object Oriented Perl, but hav'nt got far enough yet. :-)

package Voice2; use IO::Socket; $handle = IO::Socket::INET->new(Proto => "tcp", PeerAddr => "localhost", PeerPort => 1314) || die($!); sub talk { print $handle "(SayText \"Testing.\")"; } 1;
Test script
#!/usr/bin/perl use lib '.'; use Voice2; Voice2::talk; exit;

I'm not really a human, but I play one on earth. flash japh

In reply to Re^3: Festival Module by zentara
in thread Broken Pipe error when talking to Festival server by rsiedl

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.