Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

who has client side perl Run This code tell me what happens because i

Status
Not open for further replies.

Phalanx1

Programmer
Jul 21, 2003
128
US
have no idea what so ever it looks like to me that i broke ie into it component parts
<html>
<head>
<meta name=&quot;vs_defaultClientScript&quot; content=&quot;PerlScript&quot;>
<meta name=&quot;vs_targetSchema&quot; content=&quot;HTML 4.0&quot;>
<meta name=&quot;GENERATOR&quot; content=&quot;SAPIEN Technologies PrimalScript 3.0&quot;>
<title>Document Title</title>
</head>
<body id=&quot;Bel&quot;>
<div id=&quot;Response&quot;></div>
<h2>Test of a PerlScript function being called from VBScript</h2>
<p>
<input type=&quot;text&quot; id=&quot;PipeCreate&quot; value=&quot;&quot;>
<input type=&quot;button&quot; onclick=&quot;namePipe, PipeCreate&quot; value=&quot;Create Pipe&quot;><br>
<input id=&quot;WriteThis&quot; type=&quot;text&quot; size=&quot;15&quot; value=&quot;&quot;>
<input type=&quot;button&quot; onclick=&quot;WriteToPipe&quot; value=&quot;Write To Created Pipe&quot;>
<input type=&quot;button&quot; onclick=&quot;ReadFromPipe&quot; value=&quot;Read Pipe&quot;>
</p>
<input type=&quot;button&quot; onclick=&quot;Discon&quot; value=&quot;Disconnect Pipe!!&quot;>
<form method=&quot;POST&quot; action=&quot;&quot; onsubmit=&quot;javascript:return false&quot;>
<p><input type=&quot;button&quot; value=&quot;Close&quot; onclick=&quot;javascript:self.close();&quot;></p>
</form>
<p>
</p>
<script language=&quot;PerlScript&quot;>
use Win32::pipe;
sub namePipe {
$pipe = $window->document->getElementByID(PipeCreate)->value;
}
sub WriteToPipe {
$WhatToWrite = $window->document->getElementByID(WriteThis)->value;
$OurPipe = Win32::pipe(&quot;\\\\.\\Pipe\\$pipe&quot;)|| die $window->alert(&quot;Can't Create Named $pipe\n&quot;);
$OurPipe->Write(&quot;$WhatToWrite&quot;);
}
sub ReadFromPipe {
$OurPipe = Win32::pipe(&quot;\\\\.\\Pipe\\$pipe&quot;)|| die $window->alert(&quot;Can't Create Named $pipe\n&quot;);
$Data = $OurPipe->Read();
$DatRetVal =&quot;This Is The Data $Data&quot;;
$window->alert($DatRetVal);
}
sub PipeCreate {
$OurPipe = new Win32::pipe( $pipe)|| die $window->alert(&quot;Can't Create Named $OurPipe\n&quot;);
}
sub Discon {
$OurPipe = Win32::pipe(&quot;$pipe&quot;)|| die $window->alert(&quot;Can't Create Named $OurPipe err1 \n&quot;);
$OurPipe->Close()|| die $window->alert(&quot;Can't Create Named $pipe err2\n&quot;);
$OurPipe->Disconnect()|| die $window->alert(&quot;Can't Create Named $pipe err3 \n&quot;);
}
sub sayHello {
# This function takes two parameters, creates a string
# from the parameters, and returns the string.

# get the two parameters into local variables
my ($strName, $strTime) = @_;
#now, create the return string.
$strRetVal=&quot;Hello $strName. The time is $strTime.&quot;;

# Return the string
$strRetVal;
}
use IO::Socket;
use Tk;
use subs qw/read_sock/;
use vars qw/$mw $sel $sock $text/;
use strict;

$mw = MainWindow->new;
$text = $mw->Text->pack;
$sock = IO::Socket::INET->new(PeerAddr => 'localhost:10254');
die &quot;Cannot connect&quot; unless defined $sock;

if ($^O eq 'MSWin32') {
use IO::Select;
$sel = IO::Select->new;
$sel->add($sock);
$mw->repeat(50 => \&read_sock);
} else {
$mw->fileevent($sock, 'readable' => \&read_sock);
}

MainLoop;

sub read_sock {
my $hand = $sock;
if ($^O eq 'MSWin32') {
my(@ready) = $sel->can_read(0);
return if $#ready == -1;
$hand = $ready[0];
}
my $numbytes = length 'polld';
my $line;
while ($numbytes) {
my $buf;
my $num = sysread $hand, $buf, $numbytes;
$numbytes -= $num;
$line .= $buf;
}
$text->insert('end',&quot;$line\n&quot;);
} # end read_sock
</script>
<Script language=&quot;vbscript&quot;>

strOutput=sayHello(&quot;Visitor&quot;,Now & &quot;&quot;)
Response.innerText= strOutput & &quot; &quot;
</script>
<!-- Insert HTML here -->
</body>
</html>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top