Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use IO::Socket; my $sock = new IO::Socket::INET ( LocalPort => '17071', Proto => 'tcp', Listen => 1, Reuse => 1, ); die "Could not create socket: $!\n" unless $sock; my $new_sock = $sock->accept(); while(<$new_sock>) { my $command = $_; chomp($command); $command = lc($command); if($command eq "exit") { print "EXITING"; } print $command,"\n"; } print "Closing Socket..."; close($sock); print "Soocket Closed";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem using chomp on linux
by moritz (Cardinal) on Mar 17, 2009 at 08:56 UTC | |
by Anonymous Monk on Mar 17, 2009 at 09:05 UTC | |
by Nomad (Pilgrim) on Mar 17, 2009 at 09:23 UTC | |
by ig (Vicar) on Mar 17, 2009 at 18:34 UTC |