Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a unique problem... I develop Perl on a Windows machine, but my test/prod servers are AIX. I want to be able to test locally with an installation of Apache & Perl, but I don't want to have to change the #! line in all of my scripts to test locally, and then change them back to upload to the test server.

My question is this: can I create some type of shortcut/alias/whatever in Windows in the style of '/usr/bin/perl' that actually points to 'C:\ActiveState\Perl5.0.12\perl.exe' ?

I'm kind of lost on this, so any help at all is greatly appreciated. Thanks!

share|improve this question

Yes, you can. Just create the path as specified in your Perl source code. For example, if you're using #!/usr/pkg/bin/perl then on Windows you can create the path on the same drive (presumably C:) and create a symbolic link to it there (without the .exe).

Depending on what you're doing, it may or may not work, but you'll have to try. If you're expecting to just run your .pl files natively, then this won't work because Windows isn't as flexible as Unix or Linux with regard to reading the first line of a binary to determine how to execute/interpret it.

You can use the Windows "mklink" command to create your symbolic link (thanks to @grawity for suggesting that I add this point).

share|improve this answer
To add - use mklink to create symlinks. – grawity Jun 30 '11 at 20:29
Alternatively, if you're using ModPerl, then on the Windows side this shouldn't matter (and the path in the first line of your Perl scripts can be wrong without causing any problems). The configuration for mod_perl2 that I'm using is described here (complete with configuration file examples): – Randolf Richardson Jun 30 '11 at 20:30

Don't bother.

C:\> type
use strict;
use warnings;
print "that worked\n";

that worked

But I think Apache needs a correct shebang line - in which case see

share|improve this answer

You can TRY replicating the unix directory structure on your C partition and then you can create sym links accordingly, if on NTFS.. Though on NTFS, they're called "junctions" and Windows Explorer has no means of differentiating junctions from original files/dirs - you need this tool to use NTFS's junction features.

I love sym links and use them like a crazy-guy. But I avoid using junctions on NTFS because explorer doesn't show what they are and I'm afraid of forgetting what I did, or worse, others coming along and causing the world to implode, somehow. Still, that may work for ya. Though it mostly all pends on how the perl interpreter translates unix style paths for use on Windows.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.