Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Unable to use Device::SerialPort on Mac OS X

by broomduster (Priest)
on Aug 16, 2009 at 19:47 UTC ( #789042=note: print w/replies, xml ) Need Help??


in reply to Unable to use Device::SerialPort on Mac OS X

I am using Device::SerialPort with no problems on 10.4.11 (Tiger). I know of folks using it successfully on 10.5.x.

I think AnonyMonk is pointing you in the right direction w.r.t. multiple Perl installations. You start with #!/usr/bin/perl, which is the Apple-supplied Perl. But all that /opt/local/... points at MacPorts, which suggests that you also have a Perl installation from there (probably /opt/local/bin/perl; try saying which perl on the command line). My guess is that even though you think you installed Device::SerialPort by hand, you either did so using the MacPorts Perl, or you really installed it via MacPorts (looks to me that they have a port for that).

Check to be sure that you really do have a MacPorts-installed Perl and change your shebang line accordingly. As AnonyMonk suggests, also try reinstalling Device::SerialPort if the altered shebang does not work.

Disclaimer: I don't use MacPorts, so these are Intelligent Guesses, not Definitive Truth.

Updated: I see you also posted back while I was replying and that you are back on track. If you change the first line of your script to

#!/opt/local/bin/perl
you will get the right Perl installation and not have to do /opt/local/bin/perl < filename on the command line.

Replies are listed 'Best First'.
Re^2: Unable to use Device::SerialPort on Mac OS X
by Metphoto (Initiate) on Aug 16, 2009 at 22:47 UTC
    Hi

    I have just fixed the issue. Actually before I read your reply.

    It turned you were spot on!

    Some time ago I had used Porticus to install Wireshark, which POSSIBLY installed the other install of Perl. Certainly Porticus was listing a version of Perl.

    So I used Porticus to remove the naughty Perl and then reinstalled Device::SerialPort from CPAN.

    Finally I removed the unnecessary 'use lib' line from my code and bingo it works!

    Today has been a good learning experience.

    Thanks oh great monks.

    Mark

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://789042]
help
Chatterbox?
[james28909]: i figured out a neet trick
[Lady_Aleena]: james28909, what neat trick?
[james28909]: now if i have packed a script into a PDK exe, and misplaced the source, i can print it.
[james28909]: but you have to prepare for it first by adding this to the source
[james28909]: seek DATA, 0, 0; while (<DATA>) { print; }
[Lady_Aleena]: Sounds interesting. Have you written a meditation or cool use for it?
[Lady_Aleena]: It might be something PerlMonks at large would be interested in.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2017-05-01 00:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (543 votes). Check out past polls.