Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: App::perlbrew - Compiling Perl with thread support

by 7stud (Deacon)
on Jan 12, 2013 at 10:53 UTC ( #1013028=note: print w/replies, xml ) Need Help??

in reply to App::perlbrew - Compiling Perl with thread support

Here is perlbrew(0.58) help, section "install":

    install options perl-<version>
    install options <version>
        Build and install the given version of perl.

        Version numbers usually look like "5.x.xx", or "perl-5.xx.x-RCx" for
        release candidates.

        The specified perl is downloaded from the offical CPAN website or
        from the mirror site configured before.

        To configure mirror site, invoke `mirror` command.

    install options perl-blead
    install options blead
        A special way to install the blead version of perl, which is
        downloaded from this specific URL regardless of mirror settings:


    install options /path/to/perl/git/checkout/dir
        Build and install from the given git checkout dir.

    install options /path/to/perl-5.14.0.tar.gz
        Build and install from the given archive file.

    install options
        Build and install from the given URL. Supported URL schemes are
        "http://", "https://", "ftp://" and "file://".

    Options for "install" command:

        -f --force     Force installation
        -j $n          Parallel buildng and testing. ex. C<perlbrew install -j 5 perl-5.14.2>
        -n --notest    Skip testing

           --as        Install the given version of perl by a name.
                       ex. C<perlbrew install perl-5.6.2 --as legacy-perl>

        -D,-U,-A       Switches passed to perl Configure script.
                       ex. C<perlbrew install perl-5.10.1 -D usemymalloc -U uselargefiles>

        --sitecustomize $filename
                       Specify a file to be installed as

    By default, all installations are configured after their name like this:

        sh Configure -de -Dprefix=$PERLBREW_ROOT/perls/<name>

Therefore, the command to install perl 5.16.0 with thread support and to give that perl the name "perl-5.16.0t" should be this:

$ perlbrew install --as perl-5.16.0t -Dusethreads perl-5.16.0

And in fact, I tried that command on Mac OSX 10.6.8, and I was able to successfully install a perl named perl-5.16.0t:

$ perlbrew list * perl-5.16.0 #this perl was already installed perl-5.16.0t #this is the new install $perlbrew use perl-5.16.0t $perlbrew list perl-5.16.0 * perl-5.16.0t

And here's a test program:

use strict; use warnings; use 5.012; use threads; use threads::shared; my $counter :shared; $counter = 1; my $name = 'Joe'; sub do_stuff { my $thread_id = shift; sleep rand 10; say "thread number $thread_id"; say "count: $counter"; $counter++; say $name; $name = "Cathy"; } my @threads; for my $thread_number (1..10) { push @threads, threads->create('do_stuff', $thread_number); } for (@threads) { $_->join; } --output:-- thread number 5 count: 1 Joe thread number 9 count: 2 Joe thread number 3 count: 3 Joe thread number 7 count: 4 Joe thread number 10 count: 5 Joe thread number 4 count: 6 Joe thread number 6 count: 7 Joe thread number 8 count: 8 Joe thread number 1 count: 9 Joe thread number 2 count: 10 Joe

To set perl-5.16.0t as the default when you start up a shell:

$ perlbrew switch perl-5.16.0t

It's possible that the -f option for the perlbrew alias command is the same as for the install command. But in any case, options are optional--that is what the brackets around the option mean--so if you don't know what an option does, then don't use that option.

perlbrew help also says this:

Generic command options: -q --quiet Be quiet on informative output message. -v --verbose Tell me more about it.

The -v option isn't used to specify the perl version, so you can omit it.

Replies are listed 'Best First'.
Re^2: App::perlbrew - Compiling Perl with thread support
by kcott (Chancellor) on Jan 21, 2013 at 04:44 UTC

    Thanks for the info. This was actually resolved 11 months ago. The thread went to depth of Re^6 so perhaps you didn't see all the discussion.

    -- Ken

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2018-06-23 10:56 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.