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

Re^3: I installed mac ports and now all my cpan dependencies cannot be found

by roboticus (Chancellor)
on Jan 26, 2013 at 14:23 UTC ( #1015491=note: print w/replies, xml ) Need Help??

in reply to Re^2: I installed mac ports and now all my cpan dependencies cannot be found
in thread I installed mac ports and now all my cpan dependencies cannot be found


If you start the macports program with a script, you could always just add a command to set the path for that process. In bash, for example, you could just add an export PATH=... line before starting macports. I don't know how you would do that for a program started from an icon, but I'll bet you can do it if you dig through the docs. That way, macports can use it's version of perl, and for all your other work, you can use your version.

You could always do the opposite, too, removing the /opt/local directory from your path before invoking your perl scripts. In fact, that's what I do at work. I have perl linked to a script that does a bit of bookkeeping, and it removes a couple of things from the path before starting up. I'm at home right now, but if I recall correctly, it was something like:

#!/usr/bin/bash # My local perl libraries export PERL5LIB=/home/roboticus/LIB # Log when & what I run CURDTM=`date +'%Y%m%d-%H%M'` echo $CURDTM $@ >>~/.runlog # my perl executable Krevulax $@

As I mentioned, it's from memory. I don't care for bash scripting, so I don't recall the tricky bits like parameter mucking, so I expect that I've misremembered the line that passes the shell parameters to perl, but this should give you the general idea.

Just to satisfy any curiosity about "Why does he log the date and time of every script he runs?": My job is so crazy and I'm always jumping from task to task. Thus, I have a huge set of perl scripts littered around my machine. So when someone asks me "Hey, remember that thingamajig you did for me three weeks ago? Could you do it again for me?" I sometimes couldn't easily find it. So I added the logging and wrote a little report for myself that will list the different scripts I've run for a given date range. Once I recognize the name (I *do* try to give meaningful names to the scripts), I'm a simple "locate scriptname" away from it.


When your only tool is a hammer, all problems look like your thumb.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015491]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2018-02-21 08:07 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (276 votes). Check out past polls.