Aspicore UDP Perl Tools support page

Contents

1) How I can install Perl source code? Do I have to compile?

2) How I can install SQL scripts to MS SQL Server?

Questions and Answers

1) How I can install Perl source code? Do I have to compile?

Copy the source code from UDP_perl_tools.zip into some directory on your computer. Perl is an interpreted language, so there is no need to compile the source files. You need to have a Perl interpreter installed. For Windows you can get Perl interpreter e.g. from ActiveState web site.

To get familiar with Aspicore UDP Perl Tools, start with socket_udp_server.pl. Open command prompt. Go to the directory containing socket_udp_server.pl. Type one of the three alternative commands:

  • socket_udp_server.pl (This works, if the .pl extension is associated with the Perl interpreter)
  • socket_udp_server.bat (Perl must be along the PATH)
  • c:\perl\bin\perl.exe socket_udp_server.pl

You should see something like:

socket_udp_server.pl 1916: server started on port 1002 at Mon Dec 20 11:01:21 2004

(If you want to use another port, change the "my $port" line in *.pl accordingly, or use the command line argument for the port number.)

With the following commands you can test, that the server application works:

  • Leave socket_udp_server.pl running in the command prompt.
  • Start another command prompt. Go to sources directory.
  • Execute socket_udp_client.pl
  • Soon you should see a test message appearing in the first command window. This shows that the server has received an UDP message from the client.

When you start socket_udp_client.pl without parameters, it sends the test message to localhost, i.e. the same computer. If you append the command line socket_udp_client.pl with an IP address or a host name, the test message is send to the given destination computer. In the latter case, you must first start socket_udp_server.pl in the destination computer.

2) How I can install SQL scripts to MS SQL Server?

The original SQL scripts of UDP Perl Tools have been created for MySQL database. If you want to use Microsoft SQL Server or MSDE, you need to use a little different SQL script to create the database. For Microsoft databases, use the following SQL script: GSM_Tracker_MSSQL7.sql

Run the script in the SQL Server computer with osql.exe or with the MS SQL Server Query Analyzer.

You must also change the database connection settings in the Perl sources. Instead of Perl module DBD-MySQL you can use e.g. the module DBD-ODBC (ODBC driver for DBI).

First you must install this module into your Perl environment with the PPM utility, if you haven't already done it before:

ppm> install DBI
ppm> install DBD-ODBC

Next, create a DSN for database GSMTRACK with the Windows control panel applet Administrative Tools / Data Sources (ODBC). Select the tab System DSN and click the Add button. Select the driver for SQL Server and give the name DSNGSMTRACK for the new DSN. Remember to select the check box "Change the default database to" and choose the database GSMTRACK from the combo box. Finish the DSN creation.

Next modify the "my $data_source", "my $user" and "my $password" lines in the Perl sources e.g. as follows:

my $data_source = "dbi:ODBC:DSNGSMTRACK";
my $user = "";
my $password = "";

Now the Perl scripts should be ready for your MS SQL database.

For more information about the Perl ODBC Driver for DBI, Look at ActiveState web site http://aspn.activestate.com/aspn/docs/activeperl/site/lib/dbd/odbc.html. (Other Perl DBD modules: http://aspn.activestate.com/ASPN/Modules/Perl?module_name=D&order=name&query_start=106 )

Contact:
support@aspicore.com
www.aspicore.com