bedohave9 has asked for the wisdom of the Perl Monks concerning the following question:

Can I download the Strawberry Perl and execute the codes, which were already written on Active Perl? Please let me know.

Replies are listed 'Best First'.
Re: Strawberry Perl
by davido (Cardinal) on Jul 24, 2012 at 05:16 UTC

    That depends on the code. Perl code can be written quite portably. Here are some issues you might face:

    • ActivePerl may come bundled with some non-core modules that aren't included with Strawberry Perl. This would only be an issue if your program uses those modules. However, Strawberry Perl is designed to make module installation just about as simple (and standards-conformant) as possible. So you may need to install a module or two to get it working. But that's only if the Perl code happens to use a non-core module that ActivePerl bundles, and that Strawberry Perl doesn't.
    • It's possible that your code includes some pre-compiled XS code that has been compiled for use with Active Perl (ie, for use with a Perl compiled with a Microsoft compiler). That extension code wouldn't be binary compatible with Strawberry Perl. However, common practice is to distribute modules as source-code that is compiled at install time. So unless you've got something fairly non-standard, this should also be a non-issue.

    But here's the really great secret. You yourself can download Strawberry Perl for free, and you yourself can test the code to verify that it will work as expected. Installing Strawberry Perl takes just a few minutes. And you are the only one so far in this thread who has any idea what the code you intend to run looks like, so you're the only one who can render a definitive answer to your question.


    Dave

      That extension code wouldn't be binary compatible with Strawberry Perl

      Actually, such code *is* generally binary-compatible with ActivePerl - unless you mix x64 and x86 builds. (And the compatibility generally holds the other way, too.)

      If you happen to download an old version of Strawberry that wasn't built with -mms-bitfields it's possible to strike trouble.
      And if you grab the -Duse64bitint build of x86 Strawberry Perl, then you *do* lose binary compatibility with x86 ActivePerl.

      Cheers,
      Rob

      ok. I already have Active Perl in my system. Would this create any problem? In other words, do I need to uninstall the Active Perl from my system and install the Strawberry Perl?

        No, that's fine. You can install Strawberry Perl independently of ActivePerl. You will need to specify which Perl interpreter to use by either modifying your PATH or invoking the interpreter under its fully-qualified name.

        And of course if you want you can also uninstall Strawberry when you're done with it.

        If you're really concerned about messing something up by having two installs (which really is fine, but just in case you're super cautious) you can always use the thumb-drive edition of Strawberry Perl, and install it to a USB stick.


        Dave

Re: Strawberry Perl
by 2teez (Vicar) on Jul 24, 2012 at 08:45 UTC
    Hi,

    If I may add one word to davido's commet:
    "..You will need to specify which Perl interpreter to use by either modifying your PATH.."
    And that you can achieve in so many ways. Presently, I have both ActivePerl and Strawberry Perl installed and I switch between both using simple bat files to modify my PATH like so:

    • activePerl.bat file
      rem Return Perl to ActivePerl path path; path D:\Perl\site\bin;D:\Perl\bin;C:\PHP\;C:\Program Files\PC Connec +tivity Solution\;%SystemRoot%\system3;%path% rem clear the screen cls
    • strawberryPerl.bat file
      rem Add Strawberry Perl to path path C:\strawberry\perl\bin;%path% rem clear the screen cls

    • All I do after then is to run any of these bat files to switch. And voilą am :-} `happy`!!!
      Hope this helps.

      Sorry for the delay. This is wonderful. Please let me know which of the following Starwberry batch files needed to include the said code.

      rem Add Strawberry Perl to path path C:\strawberry\perl\bin;%path% rem clear the screen cls

      cpanp-run-perl.bat

      perlbug.bat

      perldoc.bat

      perlglob.bat

      perlivp.bat

      perlthanks.bat

      I am assuming that I need to include the code in 'cpanp-run-perl.bat', also do I need to add the code at the end of the file. Please help.

        You don't need to include any of the Strawberry Perl bat file, just the path to your Strawberry Perl installation.
        You will have to create the batch file yourself.
        Open a text editor like notepad, then write like so:

        rem Add Strawberry Perl to path path C:\strawberry\perl\bin;%path% rem clear the screen cls
        Then save the files as any name with the extention.bat. You might have to change your "save as type" from ".txt" to "All files (*.*)". So, that you don't end up with ".txt" extention.
        Also, take note that the path in the above bat file, might be different from yours. Please, change accordingly.
        Hope this helps!