Page 1 of 1

Running perl scripts

Posted: Tue Oct 21, 2003 2:40 am
by tmcgill
can somebody tell me what you are suppose to enter in the commands, parameters and initial folder to run a perl script.
Thanks.

Posted: Tue Oct 21, 2003 8:41 am
by bbadmin
To run the active document as a Perl script, you'll need to add a new program, as follows:

Command: C:\Perl\bin\Perl.exe (or whatever path is appropriate)
Parameters: $File
Initial folder: $FileDir
Capture output: checked, only if your scripts do not read from stdin.

The same applies to Python, except of course for the command.

Keith MacDonald
Helios Software Solutions

Posted: Fri Oct 24, 2003 1:15 am
by rock_8888
Keith,

Could you tell me how to add a new program to run the Perl? I am able to run the Perl in TestPad, however, I could not enter a variable at the command prompt.

Alternatively, I have to run my Perl script at the command line in order for me to enter a variable at the prompt.


Thanks


Dave

Posted: Fri Oct 24, 2003 3:00 am
by talleyrand
If it's truly a variable and not just a parameter, you're out of luck running it from TP.
http://www.textpad.com/forum/viewtopic.php?t=4413

Posted: Fri Oct 24, 2003 2:58 pm
by bbadmin
Dave,

I'm not sure that I've understood what your problem is. Have you read "How to customize settings: the Tools menu" in TextPad's online help file?

Keith MacDonald
Helios Software Solutions

Posted: Sat Oct 25, 2003 9:37 pm
by Bob Hansen
I thnk some of the confusion may be from this section:
To run the active document as a Perl script, you'll need to add a new program, as follows:
.
What this should say is that "You'll need to add a Tool to TextPad to run the perl program. Read "How to customize settings: the Tools menu" in TextPad's online help file.
From the Main Menu, click on Configure, Preferences.
Click on Tools, Add, Program. Browse to C:\Perl\bin\Perl.exe (or whatever path is appropriate)

Finish with the correct values, details in first reply are good:
Command: C:\Perl\bin\Perl.exe Parameters: $File
Initial folder: $FileDir
Capture output: checked, only if your scripts do not read from stdin.

After Tool is created, make a Document Class for Perl
From the Main Menu, click on Configure, Make Document Class. Enter "Perl" (without the quotes) for the document class name.
Enter *.pl for the Class members
Select the syntax for the Perl class

After Document Class is created, open Document classes and modify as needed.

After Document Class is created, make a File Name Filter for Perl.
Add Perl (*.pl) as a filter with *.pl as the extension to filter.