Hi.

Thanks for the advice. I am 'limited' to perl 5.6 ( school ) but I did manage to expand on my code base:

# Perl server #!/usr/bin/perl -w use strict; use IO::Socket::INET; local $| = 1; my $ID; my $PW; my $port = 8500; my $client; my $server = new IO::Socket::INET( LocalPort => $port, Type => SOCK_STREAM, Listen => 5, Proto => 'tcp', Reuse => 1, ) or die "Couldn't construct server on port: $port : $!\n"; $client = $server->accept(); print $client "ID:"; $ID = <$client>; print "I received $ID\n";


#Perl client. #!/usr/bin/perl -w use strict; use IO::Socket::INET; local $| = 1; my $host = '127.0.0.1'; my $port = 8500; my $ID; my $PW; my $client = new IO::Socket::INET( PeerAddr => $host, PeerPort => $port, Proto => 'tcp', Type => SOCK_STREAM, ) or die "Couldn't create client : $!\n"; my $data = <$client>; print $data; chomp( $ID = <$client> ); print $client $ID;


The primary problem is I can pass the prompt to the client ( e.g. ID? ), but I don't know how to obtain the input then return that to the server. I tried <STDIN> but the program simply hung. If I can prompt for three scalars ( ID, PW, and assignment_to_submit ) and return each piece of input to the server, I don't forsee too much difficulty in completing the remainder of the project.

Thanks,
-Katie.

In reply to Re: Re: Writing a perl based 'Homework' Server. by DigitalKitty
in thread Writing a perl based 'Homework' Server. by DigitalKitty

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.