Our applications run with Strawberry Perl, and if any other Perl (Active Perl) version is installed our application won't work. Is there any way to check if multiple Perl (Strawberry, Active) versions are installed on the machine?
Asked
Active
Viewed 534 times
-1
-
you need script or way to checking manually? – ssr1012 Dec 07 '16 at 11:31
-
1Why doesn't the application work in Active Perl? – choroba Dec 07 '16 at 11:31
-
1http://stackoverflow.com/q/5256901/1030675 – choroba Dec 07 '16 at 11:33
-
1I think the better answer would be to check _why_ it doesn't work. `perl` is supposed to be portable - my best guess would be missing default libraries, which is best checked with a `perl -e 'require ....'` type option. – Sobrique Dec 07 '16 at 11:39
-
I need an script to check multiple Perl installations. – Ninja Dec 07 '16 at 11:54
-
1What have you attempted so far, and why didn't it work? What happens when your application is run under AcrivePerl? – Borodin Dec 07 '16 at 12:35
1 Answers
1
This will tell you how many versions of perl are in the PATH directories
perl -E '@p = `which -a perl`; printf "%d copies of perl in the path\n", 0+@p'
output
2 copies of perl in the path

Borodin
- 126,100
- 9
- 70
- 144
-
-
-
@Pradeep: Rather than commenting on my answer, it would have helped us to give you better answers if you had answered some of the questions above. We can't know the details of what you're trying to do if you won't tell us. I wrote this answer in exasperation as it seemed like we weren't going to get any more information. It was a wild guess that may help someone. – Borodin Dec 08 '16 at 04:57