Ver Mensaje Individual
  #10 (permalink)  
Antiguo 09/05/2007, 02:37
jferrero
Colaborador
 
Fecha de Ingreso: mayo-2006
Ubicación: Valladolid
Mensajes: 524
Antigüedad: 18 años
Puntos: 11
Re: [Tutorial]-Instalar perl en Windows

Sí, tu mismo lo has dicho. Al tenerlo asociado al editor, no puedes ejecutar scripts por sí mismos.

Y en cuanto al CGI, pasa un poco lo mismo, pero esta vez es el servidor web el que se encarga de ejecutar el intérprete de Perl. Depende de qué servidor sea y cómo se haya realizado la instalación de Perl en el Windows, te obligará a poner esa línea completa o no.

En el Apache, por ejemplo, se suele asociar la extensión .cgi a la ejecución de Perl, pero para poder hacer eso Apache debe conocer dónde está perl.exe.

Mira lo que pone en el fichero de configuración de Apache:

Código:
# 
# Apache parses all CGI scripts for the shebang line by default.
# This comment line, the first line of the script, consists of the symbols
# pound (#) and exclamation (!) followed by the path of the program that 
# can execute this specific script.  For a perl script, with perl.exe in
# the C:\Program Files\Perl directory, the shebang line should be:

   #!c:/program files/perl/perl
Entonces, en el caso de CGI sí que es necesario poner todo el path a perl.exe.

Pero más adelante pone:

Código:
# Note you _must_not_ indent the actual shebang line, and it must be the
# first line of the file.  Of course, CGI processing must be enabled by 
# the appropriate ScriptAlias or Options ExecCGI directives for the files 
# or directory in question.
#
# However, Apache on Windows allows either the Unix behavior above, or can
# use the Registry to match files by extention.  The command to execute 
# a file of this type is retrieved from the registry by the same method as 
# the Windows Explorer would use to handle double-clicking on a file.
# These script actions can be configured from the Windows Explorer View menu, 
# 'Folder Options', and reviewing the 'File Types' tab.  Clicking the Edit
# button allows you to modify the Actions, of which Apache 1.3 attempts to
# perform the 'Open' Action, and failing that it will try the shebang line.
# This behavior is subject to change in Apache release 2.0.
O sea, que Apache también puede mirar el registro de Windows para saber qué aplicación ejecutar.

Última edición por jferrero; 20/08/2007 a las 10:47