hmmm...I've tried this two ways, one with jsut the built-in i/o methods, and another way with a tied filehandle. here's what i'm usign right now:
# note, ive tried ttyS0 and S1, same error with both $port = '/dev/ttyS0'; # creates a hidden config file in user's home dir $config = '~/.conf'; # this tests for an existing config file, # and creates one if necessary... if(! -e $config) { $PortObj = new Device::SerialPort ($port) || die(RED,"Can't open $port: $^E\n",RESET); $PortObj->databits(7); $PortObj->baudrate(19200); $PortObj->parity("even"); $PortObj->stopbits(1); $PortObj->handshake("xoff"); $PortObj->buffers(4096, 4096); $PortObj->write_settings || undef $PortObj; $PortObj->save("$config"); $PortObj->close || die(RED,"failed to close",RESET); undef $PortObj; } # and this connects to the port by loading said # config file and tying to SERIAL filehandle $PortObj = tie (*SERIAL, 'Device::SerialPort', "$config") || die(RED,"Can't open $port: $^E\n",RESET); # use non-blocking read on serial port $PortObj->read_char_time(5); $PortObj->read_const_time(500); # create flag variables initialized to zero... my $EXIT = 0; # ...when a trapped system signal is sent, set flag to 1 $SIG{'INT'} = sub { $EXIT = 1 };
i've used this before with a tied filehandle, so it should work.

__________
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
- Terry Pratchett


In reply to Re^2: Difficulties with Device::SerialPort by EvanK
in thread Difficulties with Device::SerialPort by EvanK

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.