-1

This isn't so much a "question" as a methodology I found which I believe is working.

Most servers use the path "/usr/bin/perl" ... but Strawberry Perl (strawberryperl.com) use their own unique path of "/strawberry/perl/bin" (!!) (I tried installing into a different directory as allowed by the prompt, but it wouldn't work at all then! I read somewhere that some files within the installation are 'hardcoded' to the above path.)

I am not looking forward to having to rename all the shebangs of around 400 offline files, and then having to change them all again when uploaded, and I sought another solution. I found it in something called a "symbolic link".

Basically, it's an internal Windows redirect. It basically says "If you see the path as 'usr/bin/perl' then instead go to 'strawberry/perl/bin' " There are two ways to set this up.

The first is to open up a command line terminal ("CMD" in Windows search box, then click "cmd.exe") You use "cd.." to get back to the "C:>" prompt, and then enter "/d usr\bin\perl starwberry\perl\bin\perl.exe" and click enter. This will set up the <==> symbolic link. (Note directions of the slashes) That's OK for a one time use. (It may work without adding ".exe", but to be sure...)

But I design websites offline, so I need the redirect to be set up each time I boot up. You can do this as well with a batch file.

Using a text file, enter the same data as you did at the prompt, and save it as a ".bat" file to your startup folder, (as found in the left menu when clicking "Start" button lower left) You may well find other icons for programs that also initiate at startup within this folder.

I'm 99% certain this is working, because I went into the 'usr/bin/perl' and renamed the executable files as 'perl_old.exe' and 'perl_5.12.4_old.exe" and "wperl_old.exe" (so that if a Perl script DID access "usr\bin\perl" it wouldn't find any program to run) ... and the file still ran when I put URL into the browser.

So why the switch from ActiveState? I wanted to install a particular library. I tried it via PPM and was told I didn't have authorisation. No, this isn't an "Administrator Rights" issue of Windows; it's the fact that ActiveState now want to charge $999 for access to certain files. "Well, you can still use 'dmake' to create the files downloaded direct from CPAN" Er, no, you can't ... because "dmake" is one of the files under lock and key! And without that, you cannot install ANY file from CPAN. (The term "Holding You To Ransom" springs to mind.)

Using Strawberry Perl, it's just a case of starting a command line terminal, (CMD) moving back to the root (C:>) and typing "cpan". You now type "install MODULE::name". Boom! All the files for that particular module are downloaded and installed using the "make.pl" associated with that program.

We won't get into the debate of a company charging to access items in the public domain; they're a business after all.

I know this might be teaching your grandmother to such eggs to some of the more advanced users, but there may be other people on the verge of renaming all their files when switching to Strawberry Perl. Oh, I believe their program suite also include C, C++ and Fortran compilers (no, I've no idea either!). One downside: Due to all the extra program features they install, the directory is THREE TIMES LARGER than the "ActiveState" installation!

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Cristofayre
  • 121
  • 1
  • 11
  • 2
    If it's not so much a questions as a methodology, then it may be better to turn it into a question that you then answer - that would be a better fit for the site. – Sobrique Feb 02 '15 at 09:58
  • 1
    Strawberry in Windows doesn't need the shebang line to be accurate. `#!/does/not/exist/perl` works fine, even with arguments. – Jim Davis Feb 02 '15 at 10:24
  • Indeed. Windows doesn't use shebang, it uses file associations. Also - you don't need to pay for dmake, I'm using ActiveState, and it's making use of MinGW. – Sobrique Feb 02 '15 at 10:48
  • On Windows, `#!perl` is entirely sufficient to act as a place for your arguments. Otherwise just go for compatability with our *nix brothers... – tjd Feb 02 '15 at 11:20

1 Answers1

1

I'm pretty sure your problem with ActivePerl is that you're using an older version. I've just done:

C:\Users\myaccount\Documents>perl -MCPAN -e shell

It looks like you don't have a C compiler and make utility installed.  Trying
to install dmake and the MinGW GCC compiler using the Perl Package Manager.
This may take a a few minutes...

Downloading ActiveState Package Repository dbimage...done
Downloading MinGW-4.6.3...done
Downloading dmake-4.11.20080107...done
Unpacking MinGW-4.6.3...done
Unpacking dmake-4.11.20080107...done
Generating HTML for MinGW-4.6.3...done
Generating HTML for dmake-4.11.20080107...done
Updating files in site area...done
2759 files installed

Please use the `dmake` program to run commands from a Makefile!


cpan shell -- CPAN exploration and modules installation (v2.05)
Enter 'h' for help.

cpan>

Using version:

This is perl 5, version 20, subversion 1 (v5.20.1) built for MSWin32-x86-multi-thread-64int

ActiveState has a policy of not keeping fully up to date on older versions, because of the support overhead. You can see - for example - their builds of dmake here: https://code.activestate.com/ppm/dmake/

From their web page:

Looking for access to older versions of ActivePerl?

Community Edition offers access to the newest versions of ActivePerl. Access to older versions (Perl 5.6, 5.8, 5.10, 5.12, 5.14, 5.16) is available in Business Edition and Enterprise Edition.

E.g. to use the version you're currently using (5.12), you'd need to buy support. But you could use 5.18 or 5.20 for free.

I would also note: Windows doesn't use shebang paths anyway; it uses file associations.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Sobrique
  • 52,974
  • 7
  • 60
  • 101
  • Sorry to everyone. Correct, I wasn't asking a question, I just thought I was BEING HELPFUL to people who might be in a similar predicament. Was it due to an outdated perl? I've no idea. AS simply said I didn't have authorisation to install a module lest I paid $999. (Seems a number of people on Google have the same problem; who also didn't know that you can avoid the fee by upgrading!) – Cristofayre Feb 03 '15 at 09:12
  • As for shebangs, maybe there are other paths that can be used ... if you simply want to play around on Windows. But what happens when you upload those files to a server which DOES require the shebang? Gonna spend ages changing every script to the correct shebang? Remember, I've got around 400 scripts in my offline Apache/Windows development area that are FTPed to server! Makes life a lot easier to use the file as will be uploaded. Again, THOUGHT I was offering advice to anyone who might find themselves in a similar position. I now know not to do that unless in answer to a question – Cristofayre Feb 03 '15 at 09:18
  • 1
    You can self answer your own questions. That's both fine and appropriate. The point of StackOverflow is that it's _about_ Q&A. Just bear in mind that people will vote down - or up - according to how useful they find both question and answer. My point on shebang paths is - if you just leave it as `/usr/bin/perl` and don't bother putting symlinks on your Windows system, it'll still work fine. – Sobrique Feb 03 '15 at 09:36