http://www.perlmonks.org?node_id=864178


in reply to installing strawberry and activeperl

How are you running these scripts ?
If you run them simply as script.pl, then the perl that gets invoked would be the perl that's associated with the '.pl' extension - which may be different to the perl that comes first in your path.

If, otoh, you're running them as perl script.pl then the perl that gets invoked will be the first perl in your path ... and the question then changes to "how did you go about altering the path ?".

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: installing strawberry and activeperl
by targetsmart (Curate) on Oct 08, 2010 at 11:06 UTC
    "how did you go about altering the path ?".
    when I installed strawberry perl 5.8.9, it added the C:\strawberry to the end of the path variable, so I manually entered C:\strawberry.. at the beginning of the path variable using the "my computer->properties->advanced->environmental variables->system variables->path"

    ftype Perl says Perl="C:\strawberry\perl\bin\perl.exe" "%1" %* assoc .pl says .pl=Perl
    but still the use 5.8.9; spits the error.


    Vivek
    -- 'I' am not the body, 'I' am the 'soul/consciousness', which has no beginning or no end, no attachment or no aversion, nothing to attain or lose.
      What does perl -e "print $]" produce ?
      What does perl -e "use 5.8.9" produce ?
      Are you running the scripts as script.pl or as perl script.pl and does the output change if you switch from one method to the other ?

      Cheers,
      Rob
        Thanks to all monk replies.
        I managed to get my scripts working.

        1. Uninstalled active perl 5.6.1 and strawberry perl 5.8.9 + reboot
        2. Installed strawberry perl 5.8.9,
        3. Removed the strawberry related folders from system PATH variable. (I have admin access but I just want to run strawberry for my login account )
        4. Installed active perl 5.6.1 + reboot
        5. created a new type using 'ftype strawberryperl="C:\strawberry\perl\bin\perl.exe" "%1" %*' , (ftype perl stayed like perl="C:\APPS\actperl\bin\perl.exe" "%1" %*)
        6. wrote a batch script like a) add strawberry perl related folders to the beginning of path variable b) assoc .pl=strawberryperl c) execute the scripts(/tests) d) assoc .pl=perl
        7. Execute the batch script, my goal achieved, the scripts are compatible with strawberry perl 5.8.9. without disturbing the other users environment which were using active perl 5.6.1.

        I dont think that is an efficient way to achieve the goal, but it solved the purpose. If there is an efficient way than the one I mentioned about, please let me know.

        Actually the main Idea behind installing strawberry perl was to make sure that the old scripts that I have which worked well with active perl 5.6.1 is compatible with newer strawberry perl. But one unfortunate/fortunate thing is the support for pseudo hashes has been removed from perl 5.10, so installing strawberry perl 5.12 didn't suit well for my scripts(fields module can be used, but that is a different story, as I was only asked to check compatibility). So I finally installed strawberry perl 5.8.9 and everything seems to be working fine. Thanks


        Vivek
        -- 'I' am not the body, 'I' am the 'soul/consciousness', which has no beginning or no end, no attachment or no aversion, nothing to attain or lose.