Brilliant! I installed both modules via the Module installer, (had to re-install activestate perl first) and now the script is running without errors.
PLS NOTE - I am using Activestate Perl on Win2K PRO SP2
My issue is now this: When I use the following script the program runs fine. The modem should however re-set when given the string 'ATZ'
I have copied a text file to COM1 using the command line, and the modem resets - so the modem side works fine. However, when the script outputs the string to COM1 nothing happens. Why????!? Note - there are no errors reported on the screen - so it should be working.
# Add serial port modules
BEGIN {
eval "use Win32::SerialPort";
die "$@\n" if ($@);
eval "use Win32::API";
die "$@\n" if ($@);
} # End BEGIN
use Win32;
# Define serial port parameters
# I verified all this was correct
$Port = 'COM1';
$BaudRate=38400;
$Parity="none";
$Data=8;
$Stop=1;
$HandShake="none";
# Open serial port
$ob = Win32::SerialPort->new ($Port);
die "Can't open serial port $Port: $^E\n" unless ($ob);
# Setup serial port
$SetupStat = SetupPort($BaudRate, $Parity, $Data, $Stop, $HandShake);
die "ERROR: Could not set up serial port \n" if ($SetupStat != 0);
# Write to serial port (this line should reset the modem)
$ob->write("ATZ\n"

;
# Read from serial port - Disabled by me
# $DataRead = ReadPort("OK", "2000", "0"

;
# Close serial port
undef $ob; # Close serial port
# Subroutine to setup the serial port
sub SetupPort($$$$$) {
(my $SetBaud, my $SetParity, my $SetData, my $SetStop, my $SetHshake) = @_;
# Read serial port parameters
my $baud = $ob->baudrate;
my $parity = $ob->parity;
my $data = $ob->databits;
my $stop = $ob->stopbits;
my $hshake = $ob->handshake;
$ob->baudrate($SetBaud) || return(1);
$ob->parity($SetParity) || return(1);
$ob->databits($SetData) || return(1);
$ob->stopbits($SetStop) || return(1);
$ob->handshake($SetHshake) || return(1);
$ob->write_settings || return(1);
return(0);
} # End of SetupPort
# Read serial port until message or timeout occurs
sub ReadPort($$$) {
(my $String, my $TimeOut, my $Display) = @_;
$ob->read_const_time($TimeOut); # Setup timeout value in mS
my $Reply = ""; # Initialize message
do {
($Count, $Result) = $ob->read(1); # Read serial port
$Reply .= $Result; # Build message
print "$Result" if ($Display); # Display messages if enabled
} while($Count > 0 and $Reply !~ m/$String/);
print "\n" if ($Display); # Put carriage return at end of displayed output
if ($Reply !~ m/$String/) {
print "ERROR: Read timed out waiting for '$String' \n";
return(1);
}
return($Reply);
} # End of ReadPort
Thank you all kind sirs/ladies for your immininent help...
Tels

Win2000 Network Administrator