1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#################################
#!/usr/bin/perl -w
use strict; # declare the info before use
#################################
# packages
################################
use IO::Socket::SSL; # TCP/IP sockets
use XML::simple;
##################
# parameter declaration
##################
my $refXML;
my $tempXML;
my $host = '192.168.1.15';
my $port = 12431; # selected-Port
my $uname = "foobar";
my $pw = "foobarPW";
my $protoVer = "31"; # Protocol Version
my $sock = IO::Socket::SSL->new("$host:$port");
#########################
# main procedures
# output
##########################
##################################
# commands
system("clear"); # refresh the console
###############################
print "Sandbox Environment\n";
$sock->print(qq{<Open seq="150" protocolVersion=$protoVer username="$uname" password="$pw"/>\0});
$tmpXML=print<$sock>; # Zwischenspeichern
$refXML=XMLin($tmpXML); # in Variable speichern
exit (0);
1
2
3
4
5
my tmpXML;
my refXML;
$socket->print(qq{<Open seq="$seqid" protocolVersion=$protoVer username="$uname" password="$pw"/>\0}); # Send the login data
($tmpXML) = $socket->getlines; # Read the Server Response
$refXML = XMLin(tmpXML);
2011-10-12T12:42:56 cohamaAlso, wie benutze ich die Funktion richtig?
($tmpXML) = $socket->getlines;
$tmpXML = join(//,$socket->getlines);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use IO::Socket::SSL; # TCP/IP sockets
use XML::Simple; # basic operation in terms of XML
#####################
# XML Parameter
#####################
my $refXML;
my $tempXML;
my $XMLcontent = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
###########################
my $host = '192.168.1.15';
my $port = 12431; # selected-Port
my $uname = "foobar";
my $pw = "foobarPW";
my $protoVer = "31"; # Protocol Version
my $timer = 10;
my $seqid = 911;
#####################################
my $socket = IO::Socket::SSL->new(PeerAddr=>$host,PeerPort=>$port,Timeout=>$timer);
#######################################
$socket->print(qq{<Open seq="$seqid" protocolVersion=$protoVer username="$uname" password="$pw"/>\0});
##########################################
$tmpXML = join('',$socket->getlines);
$refXML = $tmpXML->XMLin($XMLcontent, KeepRoot => 1);
1 2
$tmpXML = join('',$socket->getlines); $refXML = XMLin($tmpXML, KeepRoot => 1);
1 2 3 4
my $xs = XML::Simple->new(); $tmpXML = join('',$socket->getlines); $refXML = $xs->XMLin($tmpXML, KeepRoot => 1);
1
2
3
4
5
6
7
###################################
# Parameter
my $tmpXML = XML::Simple->new();
###################################
# programm
$tmpXML = join('',$socket->getlines);
$refXML = XMLin($tmpXML, KeepRoot => 1);