

Activestate perl windows#
Forward slash is an ordinary character inside both single- and double-quoted strings, so it almost always means what you expect.Īs perlport notes, the Windows command shell treats forward slash as introducing options and backslash as path separators. $dir = "C:\Perl\lib\$module" # still not rightĪfter headscratching and debugging $dir = "C:\\Perl\\lib\\$module" # finallyīackslash is therefore more mistake-prone and a maintenance irritant. Oh yeah, you need double-quotes for interpolation. You may want to interpolate another value into $dir. Can't find string terminator "'" anywhere before EOF at dirstuff line n. Setting $dir as in $dir = 'C:\Perl\lib' ĭoes what you expect, but say you want $dir to have a trailing slash. The situation can be a little nicer inside single-quoted strings. In double-quoted strings, you have to remember to escape the escape character to get its ordinary meaning, e.g., # my $dir = "C:\Perl\lib" # oops, $path would be 'C:Perlib' Backslash is an escape character in the Perl language, so you have to think more carefully about it.
Activestate perl code#
General advice on slashes versus backslashesĮven if your code will run on Windows only, prefer using forward-slash as the separator in hardcoded paths.
Activestate perl full#
Don’t forget to add use lib 'mygengo' if you do it this way.įor full details, read about the search process in the perlfunc documentation on require and the extra semantics for modules via use. My suggestion is to move mygengo.pm from C:\Perl\lib\MyGengo\mygengo-api\nheinric-mygengo-perl-new-ce194df\mygengo to C:\Perl\site\lib.Īs an alternative if you are using mygengo as part of another package that you’re developing, you could drop mygengo in your source tree, perhaps as a git submodule. The way the module is written, it expects mygengo.pm to be in one of the directories named in Client code then pulls it in with use mygengo
Activestate perl install#
This is an unusual location to install the module. Your comment shows that you’re using mygengo-perl-new but have it installed in C:\Perl\lib\MyGengo\mygengo-api\nheinric-mygengo-perl-new-ce194df\mygengo. Aside from calling any external programs, / will work just fine, and probably better, as it is more consistent with popular usage, and avoids the problem of remembering what to backwhack and what not to.

However, many command-line utilities of DOS vintage treat / as the option prefix, so may get confused by filenames containing /. System calls accept either / or \ as the path separator. My $filespec3 = 'c:\\foo\\bar\\file.txt' My $filespec1 = "c:\\foo\\bar\\file.txt" Users familiar with COMMAND.COM or CMD.EXE style shells should be aware that each of these file specifications may have subtle differences: my $filespec0 = "c:/foo/bar/file.txt" Perl has long been ported to Intel-style microcomputers running under systems like PC-DOS, MS-DOS, OS/2, and most Windows platforms you can bring yourself to mention (except for Windows CE, if you count that). The perlport documentation notes (emphasis added) DOS and Derivatives When you press the Enter key, Perl calls you by your name (in the example, it is Mark) and give you a dire warning.Ĭongratulations! You have installed Perl and written your first script.As far as Windows is concerned, C:/Perl/lib and C:\Perl\lib are the same directory. If you typed everything exactly as shown, you are prompted to enter your name. you can use the cd command to move to the specified directory. Some experience issues during uninstallation. In fact, you don't have to provide an extension at all, but it's good practice and helps you locate your Perl scripts easily later on.īack at the command prompt, change to the directory where you saved the Perl script. It seems that there are many users who have difficulty uninstalling programs like ActivePerl from their systems. Save the file as to a location of your choice. Word processors store text along with special formatting codes that can confuse programming languages.Ĭreate a new text file and type the following exactly as shown: Just make sure you're not using a word processor like Microsoft Word or OpenOffice Writer. Notepad, TextEdit, Vi, Emacs, Textmate, Ultra Edit and many other text editors can handle the job. All you need to write Perl programs is a text editor.
