Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Comment on

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

I use 'junction' in a batch script to achieve this. I installed the latest Strawberry Perl (5.16.1) for Windows 7 in the default directory. Then I just renamed the directory to 'strawberry-5-16'. I created a few new directories in the root:

cd c:\ mkdir strawberry-5-10 mkdir strawberry-5-12 mkdir strawberry-5-14

I then grabbed the ZIP versions of the associated Strawberry Perl versions corresponding to the directories and unzipped them directly into their respective directories.

Finally, to use the Perl I want, I just use the following batch script 'perlreloc.bat'. For example, if I want to use 5.16, I just type:

perlreloc 5-16

The script basically creates a junction (like a link in *nix) so c:\strawberry actually points to c:\strawberry-5-16 (in the above example). With this way, you don't need to use the Strawberry relocation script and older versions of Strawberry that don't support relocation will still work because when activated with the batch file, they appear to be running in their default directory - c:\strawberry.

perlreloc.bat:

@echo off REM REM Help REM if {%1}=={/?} goto HELP if {%1}=={--help} goto HELP REM REM Check args REM if not {%2}=={} goto ERROR REM ------------------------------------------------------- if {%1}=={} ( junction c:\strawberry perl -e "print \"$] \@ $^^X\n\"" ) else ( if exist c:\strawberry-%1\perl\bin\perl.exe ( junction -d c:\strawberry junction c:\strawberry c:\strawberry-%1 perl -e "print \"$] \@ $^^X\n\"" ) else goto ERROR ) goto END REM ------------------------------------------------------- :ERROR echo %0: Parameter format not correct goto END :HELP echo. echo %0 manages different versions of Perl. echo. echo USAGE: echo. echo %0 ^<Perl_version_number^> echo. echo Where ^<Perl_version_number^> is one of the following: echo. for /f "tokens=1,* delims=-" %%i in ('dir /b c:\strawberry-*') do @if +exist c:\strawberry-%%j\perl\bin\perl.exe echo %%j echo. :END

In reply to Re: Multiple Strawberry Perl Versions under Windows by VinsWorldcom
in thread Multiple Strawberry Perl Versions under Windows by jmb

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
  • Outside of code tags, you may need to use entities for some characters:
            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 surveying the Monastery: (7)
    As of 2014-08-23 06:11 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (172 votes), past polls