home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
- <html xmlns="http://www.w3.org/TR/xhtml1">
- <head>
- <title>perlwin32faq4 - Windows NT and Windows 95</title>
- <link rev="made" href="mailto:bjepson@debian.ids.net" />
- <meta name="GENERATOR" charset="iso-8859-1" />
- <link rel="STYLESHEET" href="../win32prk.css" type="text/css"
- media="screen" />
- </head>
-
- <body bgcolor="#ffffff">
- <!-- beginning of leaf header-->
-
- <table width="100%">
- <tr>
- <td bgcolor="000000" width="70" height="31"><a href=
- "http://www.activestate.com/"><img src="ASbutton.gif" alt=
- "ActiveState Home Page" border="0" width="68" height=
- "30" /></a></td>
-
- <td width="10" bgcolor="#ffffff"> </td>
-
- <td valign="middle" bgcolor="#cc0066"><font face=
- "sans-serif" size="+1" color="#ff99cc">
- Win32 FAQ</font></td>
- </tr>
- </table>
- <!-- end of leaf content--><!-- INDEX BEGIN -->
-
- <ul>
- <li><a href="#NAME">NAME</a></li>
-
- <li>
- <a href="#DESCRIPTION">DESCRIPTION</a>
-
- <ul>
- <li><a href="#Where_can_I_get_Windows_NT_infor">Where can
- I get Windows NT information?</a></li>
-
- <li><a href="#Where_can_I_get_Windows_95_infor">Where can
- I get Windows 95/98 information?</a></li>
-
- <li><a href="#What_s_the_equivalent_of_the_she">What's
- the equivalent of the shebang ("#!") syntax for
- Win32?</a></li>
-
- <li><a href="#What_s_the_equivalent_of_chmod_f">What's
- the equivalent of chmod for Win32?</a></li>
-
- <li><a href="#How_do_I_send_email_from_Perl_fo">How do I
- send email from Perl for Win32?</a></li>
-
- <li><a href="#How_do_I_schedule_jobs_on_Win32_">How do I
- schedule jobs on Win32 platforms?</a></li>
-
- <li><a href="#Where_can_I_find_Win32_ports_of_">Where can
- I find Win32 ports of UNIX tools?</a></li>
-
- <li><a href="#What_is_a_Windows_NT_service_">What is a
- Windows NT service?</a></li>
-
- <li><a href="#How_do_I_run_a_Perl_script_as">How do I run
- a Perl script as a Windows NT service?</a></li>
-
- <li><a href="#How_do_I_set_permissions_on_a_fi">How do I
- set permissions on a file?</a></li>
-
- <li><a href="#How_do_I_associate_Perl_scripts_">How do I
- associate Perl scripts with perl?</a></li>
-
- <li><a href="#perl_dash_e">Why doesn't "perl -e"
- work?</a></li>
-
- <li><a href="#What_editors_are_available_for_Windows">
- What editors are available for Windows?</a></li>
- </ul>
- </li>
-
- <li><a href="#AUTHOR_AND_COPYRIGHT">AUTHOR AND
- COPYRIGHT</a></li>
- </ul>
- <!-- INDEX END -->
- <hr />
- <br />
-
- <h1><a name="NAME">NAME</a></h1>
-
- <p>perlwin32faq4 - Windows <font size="-1">NT</font> and
- Windows 95</p>
- <br />
- <hr />
-
- <h1><a name="DESCRIPTION">DESCRIPTION</a></h1>
-
- <p>Useful information about Windows <font size="-1">NT</font>
- and Windows 95 for Perl developers</p>
- <br />
- <hr />
-
- <h2><a name="Where_can_I_get_Windows_NT_infor">Where can I get
- Windows NT information?</a></h2>
-
- <p> <font size="-1">A</font> good starting place is the printed
- documentation that came with Windows <font size="-1">NT</font>
- and on the Windows <font size="-1">NT</font> <font size="-1">
- CD</font> in the <em>support\books</em> directory. Windows Help
- files are also available.</p>
-
- <p>You can get some in-depth information on Windows <font size=
- "-1">NT</font> from the Windows <font size="-1">NT</font>
- Resource Kit, available at bookstores and from Microsoft.
- Microsoft TechNet is also a valuable resource.</p>
-
- <p>World Wide Web support for Windows <font size="-1">NT</font>
- Server is at:</p>
- <br />
- <pre>
- <a href=
- "http://www.microsoft.com/ntserver/">http://www.microsoft.com/ntserver/</a>
- </pre>
-
- <p>Support for Windows <font size="-1">NT</font> Workstation is
- at:</p>
- <br />
- <pre>
- <a href=
- "http://www.microsoft.com/ntworkstation/">http://www.microsoft.com/ntworkstation/</a>
- </pre>
- <br />
- <hr />
-
- <h2><a name="Where_can_I_get_Windows_95_infor">Where can I get
- Windows 95/98 information?</a></h2>
-
- <p>Printed documentation comes with Windows 95/98, as well as
- some documentation on the <font size="-1">CD-ROM.</font> Help
- files are available from the Start menu.</p>
-
- <p>The Windows 95 Resource Kit contains in-depth information on
- Windows 95. It's available at bookstores and software
- stores.</p>
-
- <p>World Wide Web support for Windows 95/98 is at:</p>
- <br />
- <pre>
- <a href=
- "http://www.microsoft.com/windows95/">http://www.microsoft.com/windows95/</a>
- </pre>
- <pre>
- <a href=
- "http://www.microsoft.com/windows98/">http://www.microsoft.com/windows98/</a>
- </pre>
- <br />
- <hr />
-
- <h2><a name="What_s_the_equivalent_of_the_she">What's the
- equivalent of the shebang ("#!") syntax for Win32?</a></h2>
-
- <p>Unfortunately, Win32 platforms don't provide the shebang
- syntax, or anything like it. You can try one of the two
- following methods to run a script from the command line. If all
- else fails, you can always just call the perl interpreter
- directly, as in <code>perl myscript.pl</code>.</p>
-
- <p> Although Win32 systems themselves don't use the shebang,
- the Apache webserver does. If you are using the Apache
- webserver on your Win32 system you should put the shebang line
- at the top of your CGI scripts.</p>
-
- <p>Your shebang line should look something like:</p>
- <pre>
- #!perl
- </pre>
-
- <p>For Windows <font size="-1">NT</font> 4.0, the coolest
- method is to use associated file types (see <a href=
- "#How_do_I_associate_Perl_scripts_">How do I associate Perl
- scripts with perl?</a>). If you've associated Perl scripts with
- the <em>.pl</em> extension, you can just type the name of your
- file at the command line and Windows <font size="-1">NT</font>
- will launch <em>perl.exe</em> for you. If you change the <code>
- PATHEXT</code> environment variable to include <em>.pl</em>
- files, like this:</p>
- <br />
- <pre>
- SET PATHEXT=.pl;%PATHEXT%
- </pre>
-
- <p>you can just type the file name without an extension, and
- Windows <font size="-1">NT</font> will find the first <em>
- .pl</em> file in your path with that name. You may want to set
- <code>PATHEXT</code> in the System control panel rather than on
- the command line. Otherwise, you'll have to re-enter it each
- time the command prompt window closes.</p>
-
- <p>Given this setup, you can have a Perl script called <em>
- cat.pl</em> that looks like this:</p>
- <br />
- <pre>
- while ( <> ) {
- print;
- }
- </pre>
-
- <p>and you can invoke it on the command line like this:</p>
- <br />
- <pre>
- cat myfile.txt
- </pre>
-
- <p>However, you can't invoke it with <font size="-1">I/O</font>
- redirection, like this:</p>
- <br />
- <pre>
- cat < myfile.txt
- cat myfile.txt | more
- </pre>
-
- <p>although it looks like you should be able to (this is a
- limitation of Windows <font size="-1">NT).</font> Your script
- can be in your path or you can provide a path to the file.</p>
-
- <p>Note that the file association method does not work for
- Windows 95, nor does it work with Windows <font size="-1">
- NT</font> if you have command extensions disabled. You can,
- however, still start the Perl script from an Explorer window if
- the extension is associated with perl.</p>
-
- <p>Another option is to use the pl2bat utility distributed with
- Perl for Win32 to convert your Perl script into a batch file.
- What this does is tag some Win32 batch language to the front of
- your script so that the system calls the perl interpreter on
- the file. It's quite a clever piece of batch coding,
- actually.</p>
-
- <p>If you call the pl2bat utility on your Perl script <em>
- helloworld.pl</em>, like this:</p>
- <br />
- <pre>
- C:\> pl2bat helloworld.pl
- </pre>
-
- <p>it will produce a batch file, <em>helloworld.bat</em>. You
- can then invoke the script just like this:</p>
- <br />
- <pre>
- C:\> helloworld
- Hello, World!
- </pre>
-
- <p>You can pass command line parameters, as well. Your script
- can be in your <code>PATH</code>, or in another directory, and
- the pl2bat code will usually find it and execute it correctly.
- The big advantage of this over file associations is that <font
- size="-1">I/O</font> redirection will work correctly.</p>
-
- <p>pl2bat has a number of useful command line options to affect
- how the wrapping is done, what command line switches to pass to
- perl, etc. Running <code>perldoc pl2bat</code> at the command
- line will show a full description of these options.</p>
-
- <p>The pl2exe utility is similar to pl2bat, but it puts an
- executable header on your perl script, producing an <font size=
- "-1">EXE</font> file that cannot be directly edited.
- Redirection also works correctly under scripts that have been
- run through pl2exe.</p>
- <br />
- <hr />
-
- <h2><a name="What_s_the_equivalent_of_chmod_f">What's the
- equivalent of chmod for Win32?</a></h2>
-
- <p>There is no direct equivalent of the chmod tool on Win32
- systems. For file attributes, you can use the <em>ATTRIB</em>
- command line tool (type <code>HELP ATTRIB</code> at the command
- line for details). For more complex permissions, see <a href=
- "#How_do_I_set_permissions_on_a_fi">How do I set permissions on
- a file?</a>.</p>
-
- <p>For information on the <code>chmod()</code> function, see <a
- href="perlwin32faq5.html#How_does_the_chmod_function_work">How
- does the chmod function work on Win32 platforms?</a>.</p>
- <br />
- <hr />
-
- <h2><a name="How_do_I_send_email_from_Perl_fo">How do I send
- email from Perl for Win32?</a></h2>
-
- <p>You may come across scripts that send email with an external
- mail program, as in:</p>
- <br />
- <pre>
-
- open(MAIL, '| /usr/lib/sendmail user@there.com') or "die";
- print MAIL <<EOF;
- To: user@there.com
- From: user@here.com
- Hello, World!
- EOF
- </pre>
-
- <p>These sort of scripts generally cause people to ask, ``is
- there a sendmail equivalent on Windows?'' If you need to send
- email from a Perl script, there is no need to use an external
- program like sendmail. The libnet bundle includes <code>
- Net::SMTP</code>, a module that can be used to send mail. Here
- is an example:</p>
- <br />
- <pre>
-
- use Net::SMTP;
-
- $smtp = Net::SMTP->new('here.com'); # connect to an SMTP server
- $smtp->mail( 'user@here.com' ); # use the sender's address here
- $smtp->to('user@there.com'); # recipient's address
- $smtp->data(); # Start the mail
-
- # Send the header.
- $smtp->datasend("To: user@there.com\n");
- $smtp->datasend("From: user@here.com\n");
- $smtp->datasend("\n");
-
- # Send the body.
- $smtp->datasend("Hello, World!\n");
- $smtp->dataend(); # Finish sending the mail
- $smtp->quit; # Close the SMTP connection
- </pre>
-
- <p> Another alternative is Mail::Sender, which can be used like
- so:</p>
- <br />
- <pre>
- use Mail::Sender;
-
- $sender = new Mail::Sender {smtp => 'mail.yourdomain.com', from => 'your@address.com'};
- $sender->MailFile({to => 'some@address.com', subject => 'Here is the file',
- msg => "I'm sending you the list you wanted.",
- file => 'filename.txt'});
- </pre>
-
- <p>Or Mail::Sendmail, which can be used like this:</p>
- <br />
- <pre>
- use Mail::Sendmail;
-
- %mail = ( To => 'you@there.com',
- From => 'me@here.com',
- Message => "This is a minimalistic message"
- );
-
- if (sendmail %mail) { print "Mail sent OK.\n" }
- else { print "Error sending mail: $Mail::Sendmail::error \n" }
- </pre>
- <font size="-1">A</font> Perl script for sending mail without
- using an external program is also available on Robin
- Chatterjee's Perl for Win32 page (see <a href=
- "perlwin32faq3.html#Are_there_information_sources_av">Are there
- information sources available on Perl for Win32 on the World
- Wide Web?</a>).
-
- <p>If you really need a sendmail equivalent for Windows,
- several such equivalents exist:</p>
-
- <dl>
- <dt><strong><a name="item_Blat">Blat</a></strong></dt>
-
- <dd>
- <p>Blat is a public domain program for sending email from
- the Windows <font size="-1">NT</font> command-line.
- Although it is reputed to work under Windows 95, the Blat
- authors have not tested it under Windows 95. The Blat home
- page is located at <a href=
- "http://gepasi.dbs.aber.ac.uk/softw/Blat.html">
- http://gepasi.dbs.aber.ac.uk/softw/Blat.html</a></p>
- </dd>
-
- <dt><strong><a name="item_sendmail">
- sendmail</a></strong></dt>
-
- <dd>
- <p>Microsoft has a port of sendmail available on their
- <font size="-1">FTP</font> site at <a href=
- "ftp://ftp.microsoft.com/developr/drg/unix-to-windows/ports/sendmail/">
- ftp://ftp.microsoft.com/developr/drg/unix-to-windows/ports/sendmail/</a></p>
-
- <p> <font size="-1">A</font> commercial sendmail product is
- available from MetaInfo, Inc. An evaluation version is
- available at <a href="http://www.metainfo.com/">
- http://www.metainfo.com/</a></p>
- </dd>
-
- <dt><strong><a name="item_wrmail">wrmail</a></strong></dt>
-
- <dd>
- <p>Another commercial mail product is wrmail, part of the
- slmail product from Seattle Labs. <font size="-1">A</font>
- free version is available at <a href=
- "http://www.seattlelab.com/">
- http://www.seattlelab.com/</a></p>
- </dd>
- </dl>
- <br />
- <hr />
-
- <h2><a name="How_do_I_schedule_jobs_on_Win32_">How do I
- schedule jobs on Win32 platforms?</a></h2>
-
- <p> The <font size="-1">UNIX</font> cron utility doesn't exist
- on Win32 platforms.</p>
-
- <p>For Windows <font size="-1">NT,</font> a scheduling tool
- called <code>AT</code> is available. Unlike the <font size=
- "-1">UNIX</font> cron utility, <code>AT</code> doesn't store
- its schedule in a flat file, but is configured using
- command-line arguments. Note the AT command seems to be very
- picky about syntax. Here is one example:</p>
- <pre>
- at 23:37 /interactive /every:M,T,W,Th,F,S,Su cmd /c "c:\perl\bin\perl.exe c:\test.pl"
- </pre>
-
- <p>If you don't like the command-line version of <code>
- AT</code>, there's a <font size="-1">GUI</font> version, WinAT,
- which is available with the Windows <font size="-1">NT</font>
- Resource Kit. The "Schedule" service must be running when your
- job is supposed to happen.</p>
-
- <p>Note that you may have problems when running AT or WinAT if
- the scheduled program or script requires any special rights or
- permissions other than those held by "System" (ie, if it is
- working across computers or NT domains). This is because NT
- does not properly allow you to run preinstalled NT services,
- such as the "Schedule" service as a user with network
- priveleges. It may <i>look</i> like you can set the scheduler
- to login as a user with network priveledges, but the service
- just does not recognize that user's right's and permissions and
- the System userid has only local permissions.</p>
-
- <p> An all-Perl cron-like solution exists at <a href=
- "http://www.megadodo.demon.co.uk/perl/">
- http://www.megadodo.demon.co.uk/perl/</a> which uses a familiar
- Unix-like crontab file. This script can be ran as an NT Service
- (see <a href="#What_is_a_Windows_NT_service_">How do I set up a
- Perl script as an NT Service?</a>). When you create your own NT
- service, NT lets you set the useid/password pair, and these
- services do recognize that userid's rights and permissions.
- Hence, the scheduled program or script will have the necessary
- rights.</p>
-
- <p>There are a few commercial cron-like schedulers. NTcrond, is
- available from ifdef software: <a href="http://www.ifdef.com/">
- http://www.ifdef.com/</a> and AutoTask2000 is available from <a
- href="http://www.cypressnet.com/">
- http://www.cypressnet.com/</a>. These programs <i>should</i>
- recognize the rights and priveleges of the userid you set their
- service to run under to enable the scheduled program or script
- to have the necessary rights.</p>
-
- <p>For Windows 95, there's a System Agent available with the
- Microsoft Plus! Pack. Also, there are several shareware
- scheduling utilities, notably LaunchPad and Metz Scheduler.
- These can be found on a good shareware search engine, such as
- <a href="http://www.shareware.com/">
- http://www.shareware.com/</a>. There is also an optional "Task
- Scheduler" component with IE4.01 and Windows 98.</p>
-
- <p>Because scheduled jobs on Windows <font size="-1">NT</font>
- run as a service (see <a href="#What_is_a_Windows_NT_service_">
- What is a Windows NT service?</a>), you need to take special
- steps to make sure that files and environment variables are
- available to your script.</p>
-
- <p>In some instances, Perl's internal <code>sleep</code>
- function might be an appropriate means of scheduling. For
- example:</p>
- <pre>
- $seconds = 180;
- sub action;
- while(1) {
- &action;
- sleep($seconds);
- }
- </pre>
- <br />
- <hr />
-
- <h2><a name="Where_can_I_find_Win32_ports_of_">Where can I find
- Win32 ports of UNIX tools?</a></h2>
-
- <p>You might want to take a look at the help file for Windows
- <font size="-1">NT</font> and Windows 95 commands to see if
- there's a rough equivalent distributed with your Win32
- platform. If not, try one of these URLs:</p>
-
- <ul>
- <li>
- <p>GNU-Win32 - a Win32 port of many <font size="-1">
- GNU</font> tools, as well as a complete development
- environment. <a href=
- "http://www.cygnus.com/misc/gnu-win32/">
- http://www.cygnus.com/misc/gnu-win32/</a></p>
- </li>
-
- <li>
- <p>Virtually Un*x! - various ports of <font size="-1">
- UNIX</font> programs for Win32. <a href=
- "http://www.itribe.net/virtunix/">
- http://www.itribe.net/virtunix</a></p>
- </li>
- </ul>
-
- <p>There are also several UNIX-like tools available in the
- Windows <font size="-1">NT</font> Resource Kit. Also, there are
- several UNIX-to-Win32 commercial packages available, including
- the <font size="-1">MKS</font> Toolkit from Mortice Kerns
- Systems, Inc.: <a href="http://www.mks.com/">
- http://www.mks.com/</a> and Interix from Softway Systems: <a
- href="http://www.interix.com/">http://www.interix.com/</a> (the
- product formerly known as OpenNT).</p>
-
- <p>You can also check into the Perl Power Tools, being
- developed under the UNIX Reconstruction Project. Here you can
- find UNIX tools that are being reimplemented into all Perl. You
- can see the latest at <a href="http://language.perl.com/ppt/">
- http://language.perl.com/ppt/</a></p>
- <br />
- <hr />
-
- <h2><a name="What_is_a_Windows_NT_service_">What is a Windows
- NT service?</a></h2>
-
- <p>On Windows <font size="-1">NT,</font> a service is a special
- kind of executable program that runs in the background.
- Services are used for programs that are constantly working,
- such as network protocols or database servers. Most <font size=
- "-1">WWW</font> servers on Windows <font size="-1">NT</font>
- are implemented as services.</p>
-
- <p> <font size="-1">A</font> service is different from other
- programs in several ways:</p>
-
- <ul>
- <li>
- <p>Services aren't run interactively, although the <code>
- NET START</code> and <code>NET STOP</code> commands can be
- used to start or stop a server. The Services control panel
- is used to start, stop, or pause a service.</p>
- </li>
-
- <li>
- <p>Services don't act with the authority of the logged-in
- user. That means that services can't see user environment
- variables or read files that are readable only by the
- logged-in user. You can set the account that a service uses
- in the Services control panel.</p>
- </li>
-
- <li>
- <p>Services run even when no one is logged in to the
- machine.</p>
- </li>
- </ul>
-
- <p>The most important thing to remember is that you have to
- take special steps to make resources available to services. In
- general, you need to make files available to the Everyone
- group, and you have to have environment variables (like <code>
- PATH</code>) be system environment variables.</p>
- <br />
- <hr />
-
- <h2><a name="How_do_I_run_a_Perl_script_as">How do I run a Perl
- script as a Windows NT Service?</a></h2>
-
- <p>You can run your Perl scripts as Windows NT Services via a
- program called srvany.exe, which comes with the Windows NT
- Resource Kit. Once srvany.exe is installed, read the srvany.wri
- file which should be with it. This document will explain how to
- set up registry entries for your new service.</p>
-
- <p>After you are set up, to run your script as a service
- do:</p>
- <br />
- <pre>
- x:>srvany perl script.pl
- </pre>
- <br />
- <hr />
-
- <h2><a name="How_do_I_set_permissions_on_a_fi">How do I set
- permissions on a file?</a></h2>
-
- <p>Win32 platforms don't have the same mechanisms for setting
- permissions on files as <font size="-1">UNIX</font> does. For
- files on <font size="-1">FAT</font> partitions (which means all
- files in Windows 95), you don't have to set permissions
- explicitly on a file. All files are available to all users.</p>
-
- <p>For files on an <font size="-1">NTFS</font> partition on
- Windows <font size="-1">NT,</font> you can set the security
- permissions on a file using the Explorer and the properties
- sheet of the file. Right-click the file in Explorer, and choose
- Properties from the drop-down menu. Select the Security tab,
- and click Permissions to set the Permissions on the file. Click
- Help for more information.</p>
-
- <p> <font size="-1">A</font> command-line program, <code>
- CACLS</code>, will also change the permissions on a file. For
- more details, type <code>HELP CACLS</code> on the command
- line.</p>
-
- <p>Windows 95/98 machines that are administered using Novell
- can have accounts and permissions similiar to <font size="-1">
- NT.</font> However, these permissions must be set up by the
- Novell administrator.</p>
- <br />
- <hr />
-
- <h2><a name="How_do_I_associate_Perl_scripts_">How do I
- associate Perl scripts with perl?</a></h2>
-
- <p>On Windows systems, association is the process of specifying
- which programs should be used for which kind of files. Files
- are grouped into file types, such as <font size="-1">
- JPEG</font> files or Perl scripts. The file type of a file is
- identified by its file name extension (all the letters after
- the last ``.'' in the file name).</p>
-
- <p>So, for example, we can say that there's a type of file
- called a text file, which has the file extension <em>.txt</em>,
- and which is handled by the Notepad program.</p>
-
- <p>Usually, Perl for Win32 programmers create a file type like
- Perl Script and associate the extension <em>.pl</em> with that
- type. We specify that the perl interpreter binary, <em>
- perl.exe</em>, is responsible for that file type. Several Web
- servers require that you associate your scripts with <em>
- perl.exe</em> before the script can be run.</p>
-
- <p>On Windows 95 and Windows <font size="-1">NT</font> 4.0, you
- can create a new file type and associate the perl interpreter
- with it as follows:</p>
-
- <ol>
- <li>
- <strong><a name="item_"></a></strong>
-
- <p>Open the My Computer icon on the Desktop. The My
- Computer window should appear.</p>
- </li>
-
- <li>
-
-
- <p>From the View menu in the My Computer window, choose
- Options. The Options dialog box appears.</p>
- </li>
-
- <li>
-
-
- <p>In the Options dialog box, select the File Types
- tab.</p>
- </li>
-
- <li>
-
-
- <p>Click the New Type button. The Add New File Type dialog
- box appears.</p>
- </li>
-
- <li>
-
-
- <p>In the ``Description of type'' box, type ``Perl
- Script''.</p>
- </li>
-
- <li>
-
-
- <p>In the ``Associated extension'' box, type ``.pl''.</p>
- </li>
-
- <li>
-
-
- <p>Leave the Content Type <font size="-1">(MIME)</font> box
- blank.</p>
- </li>
-
- <li>
-
-
- <p>Click the New button beneath the Actions list. The New
- Action dialog box will appear.</p>
- </li>
-
- <li>
-
-
- <p>In the Action box, type ``Open'' (it's important to use
- this name for the action!).</p>
- </li>
-
- <li>
-
-
- <p>In the ``Application used to perform action'' box, type
- <code>[full path to perl]\perl.exe %1 %*</code>, where
- [full path to perl] is the full path to <em>perl.exe</em>
- on your machine. If perl is in your path, you <em>can</em>
- put just <em>perl.exe</em>, but for esoteric reasons it's
- better to put the full path. Also, if the path to your
- interpreter includes spaces (like <em>C:\Program
- Files\perl5</em>) put in the <font size="-1">DOS</font>
- path instead (<em>C:\progra~1\perl5</em>).</p>
- </li>
-
- <li>
-
-
- <p>Click <font size="-1">OK</font> to close the New Action
- dialog box.</p>
- </li>
-
- <li>
-
-
- <p>Click <font size="-1">OK</font> to close the Add New
- File Type dialog box.</p>
- </li>
-
- <li>
-
-
- <p>Click <font size="-1">OK</font> to close the Options
- dialog box.</p>
- </li>
- </ol>
-
- <p>You can test your association by double-clicking on a perl
- script in the Explorer window. If <em>perl.exe</em> starts and
- executes the script, things are <font size="-1">OK.</font></p>
-
- <p>On Windows <font size="-1">NT</font> 4.0, you can avoid all
- the hassle of the above and just type the following from the
- command line:</p>
- <br />
- <pre>
- ASSOC .pl=PerlScript
- FTYPE PerlScript=[full path to perl]\perl.exe %1 %*
- </pre>
-
- <p>For more information on these commands, type <code>HELP
- FTYPE</code> at the command prompt.</p>
-
- <p>Note that for this to work you have to have command
- extensions enabled. (These are enabled by default; you'd know
- if you'd turned them off.)</p>
- <br />
- <hr />
-
- <h2><a name="perl_dash_e">Why doesn't 'perl -e' work?</a></h2>
- <br />
- <br />
-
-
- <p>It does - it's just that some command shells (for example
- COMMAND.COM, CMD.EXE and 4DOS) don't accept single quotes
- wrapped around command arguments.</p>
-
- <p>The safest way to do perl one-liners is to wrap the
- parameters within "" (double-quotes) the use q() and qq()
- inside the parameters. q() and qq() with put whatever is inside
- them between single-quotes or double-quotes,
- respectively.<br />
- For example:</p>
-
- <blockquote>
- <p><code>perl -e "use LWP::Simple; while(@c = head <>)
- { $c = join qq(\n\t), @c; print qq(Header info:\n\t$c\n);
- }"</code></p>
- </blockquote>
-
- <p><font size="-1">(this was all one line)</font><br />
- Run this from the command line and type in the URL to your
- favorite website, like <a href="http://www.perl.com/">
- http://www.perl.com/</a>...</p>
-
- <p>The <a href="../lib/Pod/perlwin32.html">perlwin32</a> and <a
- href="../lib/Pod/perlrun.html">perlrun</a> POD pages have more
- information on using the command line.</p>
- <br />
- <hr />
-
- <h2><a name="What_editors_are_available_for_Windows">What
- editors are available for Windows?</a></h2>
-
- <p>Windows comes with two editors that are great for editing
- Perl, NotePad and WordPad. But, if you need more features for
- ease of editing, here is a list of free and commercial
- editors:</p>
- <br />
-
- <ul>
- <li>
- <b>BBEdit</b> - <a href="http://www.barebones.com/">
- http://www.barebones.com/</a>
-
- <ul>
- <li>A Macintosh editor that supports multiple languages
- including Perl. By adding Brad Hanson's BBEdit Plug-Ins
- you can run your Perl scripts right in BBEdit</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>CodeWright</b> - <a href="http://www.premia.com/">
- http://www.premia.com/</a>
-
- <ul>
- <li>With Codewright, you choose the compiler, the
- assembler, the version control system--any tools you
- like--and Codewright works with you. Includes Perl
- language support.</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>ED for Windows</b> - <a href="http://www.getsoft.com/">
- http://www.getsoft.com/</a>
-
- <ul>
- <li>ED leads the way in intelligent language sensitive
- editing. Supporting both DOS and Windows, ED is as easy
- to use as it is to spell. Up and running straight out of
- the box for the new user but highly configurable, ED fits
- the way YOU want to work. Includes support for Perl
- syntax highlighting.</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>GNU Emacs for Windows</b> - <a href=
- "http://www.cs.washington.edu/homes/voelker/ntemacs.html">
- http://www.cs.washington.edu/homes/voelker/ntemacs.html</a>
-
-
- <ul>
- <li>"Emacs is the extensible, customizable,
- self-documenting real-time display editor."</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>HomeSite</b> - <a href="http://www.allaire.com/">
- http://www.allaire.com</a>
-
- <ul>
- <li>HomeSite 4.0 is the award-winning HTML editing tool
- that lets you build great Web sites in less time, while
- maintaining Pure HTML. Good editor for ASP, and
- PerlScript.</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>MultiEdit</b> - <a href="http://www.amcyber.com/">
- http://www.amcyber.com/</a>
-
- <ul>
- <li>MultiEdit is an multiple language editor. Perl
- language support includes - smart indenting, template
- editing, construct matching, code completion, context
- highlighting, brace/parenthesis alignment and
- line-numbering. Other MulitEdit features include multiple
- file search/replace, HTML and ASP support, web site
- management, integration with several IDEs and debuggers,
- and the ability to compare and sychronize files while
- editing.</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>NoteTab</b> - <a href="http://www.notetab.com/">
- http://www.notetab.com</a>
-
- <ul>
- <li>Seamless support for Perl and Gawk scripts (only
- commercial versions).</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>Perl Builder</b> - <a href=
- "http://www.solutionsoft.com/perl.htm">
- http://www.solutionsoft.com/perl.htm</a>
-
- <ul>
- <li>Perl Builder is a complete, integrated development
- environment (IDE) for Perl. Whether you are an
- experienced Perl developer or a non-programmer who needs
- to create Perl CGI scripts, Perl Builder's visual tools
- are guaranteed to dramatically improve your productivity!
- Perl Builder is a 32-bit application and requires Windows
- 95 or NT.</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>Perl Scripting Tool</b> -
-
- <ul>
- <li>PST was intended as a replacement for Windows'
- Notepad, which until now has been the editor of choice
- for Win32 PERL Programmers. While Notepad is usually
- sufficient there has long been the need for something
- with 'just a little more'. This simple editor is Notepad
- with a few extra options for PERL script authoring,
- including a subroutine library, code wizard, run, debug,
- syntax check, floating toolbox and more. An extremely
- simple and straight-forward PERL GUI.</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>Programmer's File Editor (PFE)</b> - <a href=
- "http://www.lancs.ac.uk/people/cpaap/pfe/">
- http://www.lancs.ac.uk/people/cpaap/pfe/</a>
-
- <ul>
- <li>PFE is a large-capacity, multi-file editor that runs
- on Windows 98, Windows 95, Windows NT 4.0 and Windows
- 2000 on Intel-compatible processors, and on Windows 3.1x.
- Although it's primarily oriented towards program
- developers and contains features like the ability to run
- compilers and development applications, it also makes a
- very good general purpose editor for any function at
- all.</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>TextPad</b> - <a href="http://www.textpad.com/">
- http://www.textpad.com</a>
-
- <ul>
- <li>TextPad is a fully featured text editor for Windows.
- 16 and 32 bit editions available.</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>UltraEdit</b> - <a href="http://www.ultraedit.com/">
- http://www.ultraedit.com/</a>
-
- <ul>
- <li>UltraEdit is a disk based editor with a 16-Bit
- version for Windows 3.x and a 32-Bit version for Windows
- NT and Windows 95 (not Win32s). It includes bazillions of
- features including a Perl wordfile for Perl syntax
- highlighting.</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>VIM</b> - <a href="http://www.vim.org/">
- http://www.vim.org</a>
-
- <ul>
- <li>The "Vi IMproved" editor -- Now with Perl support.
- VIM provides Perl syntax highlighting, and a Perl
- interface. The Perl interface provides the ability to run
- a Perl command or run a Perl command for each line in a
- range. For more information on Perl support, see the Perl
- and VIM help page.</li>
- </ul>
- <br />
- </li>
-
- <li>
- <b>VisualSlickEdit</b> - <a href=
- "http://www.slickedit.com/">http://www.slickedit.com</a>
-
- <ul>
- <li>Visual SlickEdit combines the richest set of powerful
- editing features with more configurability than any
- software product in any category. Visual SlickEdit is
- multi-platform, highly extensible, and fast -- Includes
- language color-coding extention for Perl.</li>
- </ul>
- <br />
- </li>
-
- <li><b>WinEdit</b> - <a href=
- "http://www.windowware.com/winware/winedit.html">
- http://www.windowware.com/winware/winedit.html</a> <br />
- </li>
- </ul>
- <br />
- <hr />
-
- <h1><a name="AUTHOR_AND_COPYRIGHT">AUTHOR AND
- COPYRIGHT</a></h1>
-
- <p>This <font size="-1">FAQ</font> was originally assembled and
- maintained by Evangelo Prodromou. <a href=
- "mailto:evangelo@endcontsw.com">evangelo@endcontsw.com.</a> It
- has been revised and updated by Brian Jepson of O'Reilly and
- Associates, and David Grove, David Dmytryshyn of ActiveState,
- Kevin Meltzer and Eric Smith.</p>
-
- <p>This <font size="-1">FAQ</font> is in the public domain. If
- you use it, however, please ensure that you give credit to the
- original authors.</p>
-
- <p><!-- beginning of leaf footer--></p>
-
- <table width="100%">
- <tr>
- <td bgcolor="000000" width="70" height="31"><a href=
- "http://www.activestate.com/"><img src="ASbutton.gif" alt=
- "ActiveState Home Page" border="0" width="68" height=
- "30" /></a></td>
-
- <td width="10"> </td>
-
- <td valign="middle" bgcolor="#cc0066"><font face=
- "sans-serif" size="+1" color="#ff99cc">
- Win32 FAQ</font></td>
- </tr>
- </table>
- <!-- end of leaf footer-->
- </body>
- </html>
-
-