CPAN question

2011-11-01 Thread Phil Dobbin
Hi. I have three versions of perl on my machine (Macbook Pro running 10.6.8.): v.5.12 in /opt/local/ for MacPorts, v.5.10 in /usr/bin/ which is the system perl & my developer perl v.5.14 in /usr/local/. I use the /usr/local/ version for everything & leave the other two to their intended purp

Re: CPAN question

2011-11-01 Thread Shawn H Corey
On 11-11-01 02:38 PM, Phil Dobbin wrote: I use the /usr/local/ version for everything & leave the other two to their intended purposes. My question is how do I configure CPAN to install into /usr/local/? I think perlbrew can be used to switch between installed Perls. If so, switch to the one y

subroutines, my and parentheses

2011-11-01 Thread rent0n
Hi all, Can somebody please explain what is the difference between: sub subroutine { my $var = @_; ... return 1; } and: sub subroutine { my ($var) = @_; ... return 1; } I think it's something related to the context but I'm not completely sure.

Re: CPAN question

2011-11-01 Thread Phil Dobbin
On 1/11/11 at 18:45, shawnhco...@gmail.com (Shawn H Corey) wrote: I think perlbrew can be used to switch between installed Perls. If so, switch to the one you want and run `cpan`. This will cause cpan to use the active perl and install the modules in its @INC directories. I use perlbrew to i

Re: subroutines, my and parentheses

2011-11-01 Thread Uri Guttman
On 11/01/2011 03:02 PM, rent0n wrote: Hi all, Can somebody please explain what is the difference between: sub subroutine { my $var = @_; that puts @_ in a scalar context which returns the number of elements in an array. ... return 1; } and: sub subroutine { my ($var) = @_; ... that puts

Re: CPAN question

2011-11-01 Thread Paul Johnson
On Tue, Nov 01, 2011 at 07:18:06PM +, Phil Dobbin wrote: > From the Googling I did concerning this, I came across perlbrew & > bootstrapping using local::lib but wondered if there was a simpler > solution. Quite. > What’s your opinion on hard-pathing to CPAN a la `$ > /usr/local/bin/perl -MC

Re: CPAN question

2011-11-01 Thread Phil Dobbin
On 1/11/11 at 19:42, p...@pjcj.net (Paul Johnson) wrote: > On Tue, Nov 01, 2011 at 07:18:06PM +, Phil Dobbin wrote: [snip] > > What’s your opinion on hard-pathing to CPAN a la `$ > > /usr/local/bin/perl -MCPAN -e shell’ in order to use the CPAN that’s > > installed there to install modules i

Re: subroutines, my and parentheses

2011-11-01 Thread Jim Gibson
On 11/1/11 Tue Nov 1, 2011 12:02 PM, "rent0n" scribbled: > Hi all, > > Can somebody please explain what is the difference between: > > sub subroutine { > my $var = @_; > ... > return 1; > } > > and: > > sub subroutine { > my ($var) = @_; > ... > return 1; > } > > I think it's something rel

Re: CPAN question

2011-11-01 Thread Shlomi Fish
On Tue, 1 Nov 2011 18:38:38 + Phil Dobbin wrote: > Hi. > > I have three versions of perl on my machine (Macbook Pro running > 10.6.8.): v.5.12 in /opt/local/ for MacPorts, v.5.10 in > /usr/bin/ which is the system perl & my developer perl v.5.14 in /usr/local/. > > I use the /usr/local/

Re: CPAN question

2011-11-01 Thread Phil Dobbin
On 1/11/11 at 21:09, shlo...@shlomifish.org (Shlomi Fish) wrote: > You can do «/usr/local/bin/perl -MCPAN -e 'shell'» or a different CPAN.pm (or > CPANPLUS/etc.) command. Hi. Yeah, I ended up setting up an alias in my .bash_profile as so: alias cpan=’sudo /usr/local/bin/perl -MCPAN -e shell’ &

Re: CPAN question

2011-11-01 Thread John Delacour
At 18:38 + 1/11/11, Phil Dobbin wrote: I use the /usr/local/ version for everything & leave the other two to their intended purposes. My question is how do I configure CPAN to install into /usr/local/? The way I do it is simply: $ cd /usr/local/bin; sudo ./cpan No disrespect to Perlbrew

timing out threads

2011-11-01 Thread Danny Wong (dannwong)
Hi all, I would like to perform the following, start X (say 10) number of threads to perform some operation (ex. Copy command), I would like to exit or return out of the thread(s) that takes too long ( ex. 30 minutes ). I'm thinking I should spawn an independent thread (a watch thread) and

Re: timing out threads

2011-11-01 Thread Zachary Zebrowski
Hi, $0.02 Look on cpan for the various proc:: modules. If you're doing something like a file copy, and need to shell out to do something, consider looking at : http://search.cpan.org/~bzajac/Proc-Background-1.10/lib/Proc/Background.pm. For me, it works when I need to do something on the command l

Re: bootstrap.pl for setting up my machine

2011-11-01 Thread Peter Scott
On Sat, 29 Oct 2011 23:24:10 +0200, Sime Ramov wrote: > * Shlomi Fish [2011-10-29T19:03+0200]: >> Since you're not interested in the output of the pkg_add command, you >> should do: >> >> system("pkg_add", $_); > > Actually, I am. I want to be able to interface with the program. E.g. if > there