modprobe is simply a Linux command to load a kernel module; a maybe-necessary prerequisite for working with hardware but probably not. (The udev facility will probably do that for you.)

The real “issue” here is device-name stability. And, looking at the big-picture here, I don't think that you should have any assumption (much less dependency) concerning the mapping of device-names to the various pieces of equipment that you will need to be talking to.

Essentially, you should assume that this mapping will change for one reason or another:   controller cards can move, cables can be moved, different Linux/Unix versions, and so-on. None of which have any meaning to anyone in terms of the actual application... who have the very odd tendency to give various devices names like “Sneezy” and “Grumpy.”

Therefore... just let 'em do that. Set up a configuration file of some kind that allows them to map an arbitrary moniker to an arbitrary device-name:

grumpy=/dev/ttys4
And then refer to all devices, anywhere and everywhere, by those monikers.

grumpy thus becomes an abstract, symbolic name that actually means something to somebody. When (not if...) someone moves cables around, only this file needs to be changed.

If the devices in question have some way to identify themselves, e.g. a device serial-number query or some other kind of unique-identifier, then so much the better:   you can give your program both a list of devices to consider and (separately) a list of identifiers to seek.


In reply to Re: Device::SerialPort and new RS-232 cards by Anonymous Monk
in thread Device::SerialPort and new RS-232 cards by Bruce32903

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.