hi, me again..
i found why i cant use perl -MCPAN -e 'install Device::SerialPort' and get an error message like i posted,
becoz this module need to run h2ph command, and i found in RedHat & Mandrake OS, had2 file maybe strange, the strange file are /usr/include/asm/string-486.h and checksum.h
i just move these 2 file to somewhee else then run h2ph -r -l . seen ok now, and i try a script from demo script:
===========================================================
#!/usr/bin/perl -w
use strict;
use vars qw( $OS_win $ob $file );
use Device::SerialPort;
$file = 'ttyS0.cfg';
$ob = Device::SerialPort->start ($file) ||
die "Can't open serial port from $file: $^E\n";
my $baud = $ob->baudrate;
print "baud from configuration: $baud\n";
my $databits = $ob->databits;
print "databits from configuration: $databits\n";
my $parity = $ob->parity;
print "parity from configuration: $parity\n";
my $stopbits = $ob->stopbits;
print "stopbits from configuration: $stopbits\n";
===========================================================
this was ok now, but my new problam is i read the DESCRIPTION on http://search.cpan.org/author/COOK/Device-SerialPort-0.12/SerialPort.pm hard to understand what cammand can let me send a command to /dev/ttyS0 and get the respond,
can someone help me!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.