I have been developing my scripts using Strawberry perl installed in C: drive (5.20.11) I've now installed the portable version on my USB stick. (5.28.xx) Whatever I try, it ALWAYS reverts to the primary version in C:
I know this as I put this at the top of the script (print $];) and always comes back as 5.2011.
I tried using a modification of the standard Strawberry bat file that starts the USB version of perl
@echo off if not "%1" == "/SETENV" setlocal set PATH=%~dp0perl\site\bin; sample.pl pause
... thinking that would set the path to the required version, but still loads from C: drive !!
I tried the above path line as the first line of script,(no ball -fact the script will run without ANY shebang?)
Not to mention the shortcut link which uses "explorer.exe" so I can add the "..\script_path\sample.pl" in the Target field ... (that method doesn't work with cmd.exe in target. With a link after the program name, all it does is open CMD with directory set to "RunMe") which then complains that "sample.pl" is not a command or script. (Even tried "perl sample.pl" ... as you would enter in CMD will not work)
OK,so end user will not have two versions running ... but that don't help me any !
(After lunch, will try changing name of C:Strawberry so it can't be found at boot up ... but that seems a little drastic!)
NB: On stick, it's "strwawberry/perl/bin/perl.exe",the other is "R:\School Programs\sample.pl", "School Programs\sample.bat" and shortcut is "R:\RunMe\sample.bat" in the target field.(Start In is empty ... I can't set this as Drive letter will vary from user to user !)
Totally lost !!