Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

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

COMMAND: 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:

            http://perl5.git.perl.org/perl.git/snapshot/blead.tar.gz

    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 http://example.com/mirror/perl-5.12.3.tar.gz
        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 sitecustomize.pl

    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.


In reply to Re: App::perlbrew - Compiling Perl with thread support by 7stud
in thread App::perlbrew - Compiling Perl with thread support by kcott

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!
  • 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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (8)
    As of 2015-07-06 22:52 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (84 votes), past polls