Capturing a data squirt.

R

Richard S Beckett

Guys,

The infra red port on my laptop is com4. When I point my palm pilot at it,
and send a file it works just fine, and the file is transferred. (Running
w32)

I want to capture this data squirt, and store it in a file, so I tried
this...

use strict;
use warnings;
use Win32::SerialPort;
open( PORT, "+>COM4" ) or die "Can't open COM4: $!";
open (FILE, ">file.txt");
while (1) {
my $input = <PORT>;
print FILE "$input\n";
}

However all I get is a file containing nothing at all.

Can anyone help me, please?

Thanks.
 
T

Terry L. Ridder

Richard said:
Guys,

The infra red port on my laptop is com4. When I point my palm pilot at it,
and send a file it works just fine, and the file is transferred. (Running
w32)

I want to capture this data squirt, and store it in a file, so I tried
this...

use strict;
use warnings;
use Win32::SerialPort;
open( PORT, "+>COM4" ) or die "Can't open COM4: $!";
open (FILE, ">file.txt");
while (1) {
my $input = <PORT>;
print FILE "$input\n";
}

However all I get is a file containing nothing at all.

Can anyone help me, please?

perldoc perlfaq8

how do i read and write the serial port?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,079
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top