BEGIN { # Add the @INC path the directory where the DSSClient module is found. push (@INC, "dss"); } use strict; use warnings; use DSSClient; if (scalar(@ARGV) != 2) { die "Usage: perl perl_client \n"; } my $host = $ARGV[0]; my $port = $ARGV[1]; #my $portTwo = $ARGV[2]; my $client = new DSSClient($host, $port); my $cmd = undef; my $result = undef; # Connect to the CCS json server. $client->open(); #Send commands to DSS Test Server #---------------- #Set breakpoint $cmd = { "name" => "setBreakpointByLineNo", "fileName" => "SCHM.c", "lineNo" => "306", }; execute_command($cmd); # We are done now. $client->close(); # Duplicate close call will fail $client->close(); #------------------ # execute command sub execute_command { $result = $client->execute($_[0]); if (defined $result) { print "$_[0]{name}: ". $result->{"status"} . "\n"; # If there is a message, print it if (exists $result->{"message"} ) { print " message: " . $result->{"message"} . "\n"; } # If a value was returned, print it if (exists $result->{"value"} ) { print " value: " . $result->{"value"} . "\n"; } } else { print "$_[0]{name} execution failed\n"; } }