Running perl scripts

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
tmcgill
Posts: 1
Joined: Tue Oct 21, 2003 2:34 am

Running perl scripts

Post 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.
User avatar
bbadmin
Site Admin
Posts: 1038
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Post 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
rock_8888
Posts: 1
Joined: Fri Oct 24, 2003 1:10 am

Post 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
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post 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
I choose to fight with a sack of angry cats.
User avatar
bbadmin
Site Admin
Posts: 1038
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Post 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
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post 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.
Hope this was helpful.............good luck,
Bob
Post Reply