Use Strict gives me BareWord "AHCMD" line 55.
AHCMD is needed.

Use Warnings gives me Useless use of 1's complement (~) in void context line 53.
If I comment out line 53, the command to the system does not work. Line 53 is needed. Somehow it filters out the text "Get", "HTTP", etc

Updated code:
#!/usr/bin/perl package main; use IO::Socket; use Sys::Hostname; use Socket; use strict; use warnings; use Wx; use wxPerl::Constructors; use base 'Wx::App'; use Wx qw(wxTE_MULTILINE wxVERTICAL wxID_DEFAULT); my($ipaddr)=inet_ntoa((gethostbyname(hostname))[4]); my $local; my $addr; my $path; my $app = Demo::App->new; $app->MainLoop; package Demo::App; use base 'Wx::App'; sub OnInit { my $frame = Demo::App::Frame->new; $frame->Show(1); } package Demo::App::Frame; use Wx qw(:everything); use base 'Wx::Frame'; sub new { my ($class) = @_; my $self = $class->SUPER::new( undef, -1, "X10 Voice Commander", wxDefaultPosition, wxDefaultSize, );$local = IO::Socket::INET->new( Proto => 'tcp', # protocol LocalAddr => "$ipaddr:8086", ) or die "$!"; $local->listen(); $local->autoflush(1); while($addr = $local->accept() ) { while (<$addr>) { $path = "C:/Program Files (x86)/Common Files/X10/Common"; chdir($path) or die "Cant chdir to $path $!"; ~s/GET//,~s/~/ /g,~s/%20/ /g,~s/%22/ /g,~s/x10command=DEVICE/ +/,~s/\//\ /g,~s/[?]//g ,~s/'/ /g,~s/HTTP/ /,~s/1.1/ /g,~s/sh://; system(AHCMD. "$_"); $self->{text} = Wx::TextCtrl->new($self, -1, "", [-1,-1], [500, 50 +0], wxTE_MULTILINE); $self->{text}->WriteText("Use Your IP $ipaddr:8086 on your device. +\n"); $self->{text}->WriteText("Connection From: "); $self->{text}->WriteText($addr->peerhost()); $self->{text}->WriteText("\n"); $self->{text}->WriteText("Received: $_"); print "Received: $_"; close $addr; } return $self; #This has something to do with it? Return where??? } }

In reply to Re^4: Wx Server reform by gg4000
in thread Wx Server reform by gg4000

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.