TSE: Language: Computer: Perl

11 views
Skip to first unread message

knud van eeden

unread,
Jan 28, 2023, 3:30:41 PM1/28/23
to SemWare TSE Pro Text Editor
Hello,

FYI

How to compile Perl programs from within TSE?

1. -Always create a backup (e.g. copy) of the file compile.dat in your TSE main directory

2. Information about Perl


3. To learn Perl


4. To install Perl (on Microsoft Windows)

ChatGPT: "How to install Strawberry Perl on Microsoft Windows?"

To install Strawberry Perl on Microsoft Windows, you can follow these steps:

Download the latest version of Strawberry Perl for Windows from the official website (https://strawberryperl.com/).
Run the downloaded executable file to begin the installation process.
Follow the prompts to choose the destination folder and any additional options you want to include in the installation.
Once the installation is complete, you can open the command prompt and type "perl -v" to confirm that Perl has been installed and to see the version number.
You can also add the path of the Perl installation to your system's PATH environment variable, so you can run Perl from any location on your system.
Note: If you are installing Strawberry Perl on a Windows operating system older than Windows 7, it's recommended to use the 32-bit version.

5. Create a .bat file COMPERL.BAT (e.g. save it in your TSE path and adapt the path to the conditions on your system)

@REM version 1.0.0.0.1
@REM [kn, ri, sa, 28-01-2023 19:35:15]
g:\language\computer\perl\strawberry\perl\bin\perl.exe %3 >%6 2>&1
@ECHO.
g:\language\computer\perl\strawberry\perl\bin\perl.exe %3
@ECHO.
@PAUSE

6. Add these TSE compiler options (e.g. run my chanblab.s and merge (or add it manually))

Extension=.py
Description=Perl: Knud
Command=COMPERL.BAT &name& &ext& &fn& &drive& &path& &output&
Output=Don't Clear Screen or Prompt After Shell
 -Error=^.*Error: .+$\c
  Error: Options=x
  Error: Extra line (default empty line)=
 -FileName=File "{.+}",
  FileName: Options=xb
  FileName: Tag=1
 -Line=line {.+}
  Line: Options=xb
  Line: Tag=1
 -Column=^[ \t]*\c\^
  Column: Options=xb
  Column: Tag=-2
 -Message=^.*Error: {.#}
  Message: Options=xb
  Message: Tag=0
User Macro=
------------------------------------------------------------------------------

7. For Perl syntax highlight:

    -Use the default perl.syn

    -Computer: Editor: Text: TSE: Syntax: Highlight: Language: Computer: Perl: File: Source: perl.txt

8. Create a file helloworld.py (case insensitive) in TSE and compile it from TSE (e.g. <CTRL><F9>)

print "Hello world";

9. That will show

Hello world

10. Tested successfully in
    Microsoft Windows Professional 10
    TSE version 4.42

See also:

Contents of TSE's compile.hlp file

with friendly greetings
Knud van Eeden

John McMahon

unread,
Jan 28, 2023, 10:09:30 PM1/28/23
to sem...@googlegroups.com
Knud,

I am not sure why you would go to all this trouble. Why not just use the
included 'pl2bat.bat' converter included with every Windows version of
Perl I have come across since the late 1990's (not sure about Cygwin,
never used it).

Alternatively, if you use JPSofts Take Command shell (or possibly
others), just add a 'shebang' line (!# perl -w) at the start of the
script and give the script a '.cmd' extension.

John
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to semware+u...@googlegroups.com
> <mailto:semware+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/semware/1113880731.885833.1674937835124%40mail.yahoo.com <https://groups.google.com/d/msgid/semware/1113880731.885833.1674937835124%40mail.yahoo.com?utm_medium=email&utm_source=footer>.

--
Regards
(
)
c[__] John McMahon

knud van eeden

unread,
Jan 29, 2023, 6:00:04 AM1/29/23
to sem...@googlegroups.com, John McMahon
What applied here is a general method to compile (almost) (every) computer language from inside TSE in the same way (e.g. always pressing only <CTRL F9>, always getting the command line compile errors back in TSE, always seeing also the output on the command line screen (of cmd.exe, tcc.exe, ...) and all this automatically). Is that possible? The answer is yes and that is what is conveyed.

That should thus in general be contrary to applying ad hoc methods to compile specific programming languages, e.g. outside of TSE.

Sent from Yahoo Mail on Samsung Galaxy S22 Ultra 512 gigabytes

--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

knud van eeden

unread,
Jan 29, 2023, 7:13:44 AM1/29/23
to sem...@googlegroups.com, John McMahon
For example I think that the only programming language where this principle is applied to the fullest and where it also works at this moment is for e.g. TSE SAL .s programs itself.

For example this simplest TSE SAL .s program:

PROC Main()
 1/0
END

Note: There is clearly a deliberately introduced error by me in this program, that is '1/0'.

Now when you compile thus using <CTRL F9> you see that the screen is split automatically in 2 parts, that is showing the program itself in the top and also showing the error(s) in the other split screen, where you can switch in between if you want.

Note: Actually the command line screen which runs sc32.exe to compile is HIDDEN, so you do NOT see that (that is the running of 'sc32.exe' behind the screens)

Note: But it is possible to see the compiling of sc32.exe with it (error) output also via choosing another setting in the compiler menu.

You see thus that the TSE compile error is: 'Error 2333 (2,2) syntax error.

(and  when clicking on that error it will jump automatically to that line and or column number in your source code program)

Inline image

Now are you also seeing that with your Perl compile implementation when compiling a Perl program???

I guess not...

But this is what I now see in TSE using the below parameters and <CTRL F9> to compile a Perl program.

(and that is seen similarly seen for every programming language thus).

Inline image

Inline image

You see thus that the Perl error is 

'Illegal division by zero at f:\BBC\TAAL\helloworld.pl line 3'

(and  when clicking on that error it will jump automatically to that line and or column number in your source code program)

Similar for Java after pressing <CTRL F9> inside of TSE:

Inline image

Inline image

You see thus in TSE that the Java error is, which will when clicking on it jumpt to that line and or column number in your source code program)

'Helloworld.java:7: error: class, interface or enum expected'

(and  when clicking on that error it will jump automatically to that line and or column number in your source code program)

Similar for C++:

Inline image


Inline image

You see thus 2 errors in the C++ program shown inside in TSE:

'Error E2190 f:\bbc\taal\helloworld.cpp 6: Unexpected )'
'Error E2040 f:\bbc\taal\helloworld.cpp 8: Declaration terminated incorrectly'.

(and  when clicking on that error(s) it will jump automatically to that line and or column number in your source code program)

I hope you get the point now.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/semware/2025515229.1020091.1674989995568%40mail.yahoo.com.

knud van eeden

unread,
Jan 29, 2023, 7:32:54 AM1/29/23
to sem...@googlegroups.com, John McMahon
1. Altogether is that TSE native program 'compile.s' (located in the TSE 'mac' subdirectory) thus a very smart TSE program,
   written by a genius and a very smart person.

2. See read also the corresponding TSE compile.hlp text here:


Rick Hodgin

unread,
Jan 29, 2023, 9:29:22 AM1/29/23
to sem...@googlegroups.com
Knud,

Rather than posting 270+ languages, why not just create a project manager in SAL that lets us add any type of file, edit them, compile them.

In that way you incorporate all 270+ languages, but without the 270+ posts.

Call it TSE Project Manager.  Let it have an area for files, an area for editing, ability to zoom full editor window size, an area showing compile errors, the ability to have something like a MAK file for building whole apps and not just compiling files.

Just a thought.

-- 
Rick C. Hodgin


knud van eeden

unread,
Jan 29, 2023, 11:09:38 AM1/29/23
to SemWare TSE Pro Text Editor
> Call it TSE Project Manager.  Let it have an area for files, an area for editing, ability to zoom full editor window size, an area showing compile errors, the ability to have something like a MAK file for building whole apps and not just compiling files.

a. Most of those proposed elements already exist.

b. All one would have to do in the simplest case is maybe putting those macro in a separate Menu() or List()

E.g.

===

1. > Let it have an area for files

One can use the native TSE macro 'where.s' for that to search and filter on file extension (e.g. .cpp, .java, ...).

One can use the PotPourri makro to navigate only e.g. .cpp files.

Or use my navigate only files which fullfile your given search string (e.g. in the ring only navigating through all filenames containing the word '.conf', '.log', '.cpp', '.h', ...)

===

2. >  an area for editing

That is exactly what the native TSE macro 'compile.s' is doing, that  is it splits the screen automatically in 2 horizontal subscreens, one for the editing of the source code and one for showing and going to the error messages.

===

3. > ability to zoom full editor window size

My recommendation is to use AquaSnap 
for those windows actions (e.g. full size window, 1/2 size, 1/4 size, left, right, bottom, top, ...)
That is just a fantastic program and a dream to work with.

Otherwise I use already for years Carlo Hogeveen's automatically maximize and back to original size TSE window program every day,
e.g. to show too small menus on my full screen instead with automatic shrinking of the menu font size if necessary.

===

4.  > an area showing compile errors,

If you use thus e.g. my proposed settings for compile.s (see my email 'TSE: Language: Computer: C++)  
you will get your error area thus out of the box in TSE. 

That split and show error window functionality has thus already existed in TSE for about 40 years (since 1985++),
it is thus only not been that much exposed fully.

5. > something like a MAK file for building whole apps and not just compiling files.

These are similar to your load your .cpp file, then TSE menu 'macro' > 'compile menu' > 'List' > then press <ALT E> options:

Extension=.cpp
Description=C++: Knud
Command=COMCPP.BAT &name& &ext& &fn& &output&
Output=Don't Clear Screen or Prompt After Shell
 -Error=^{{Warning}|{Error}|{Fatal} {W|E|F}[0-9]* #{.*} {[0-9]#}: {.@}}$\c
  Error: Options=i
  Error: Extra line (default empty line)=
 -FileName=
  FileName: Options=
  FileName: Tag=6
 -Line=
  Line: Options=
  Line: Tag=7
 -Column=
  Column: Options=
  Column: Tag=
 -Message=
  Message: Options=
  Message: Tag=1
User Macro=
------------------------------------------------------------------------------

That would one thus implement out of the box by adding something like this as a new compile option 

Description: C++: MakeFile
...
Command=MYMAKEFILE.BAT &name& &ext& &fn& &output&
...

and there you go with an initial project manager.

Note: Of course I have already implemented very similar here on my system. 
I have a separated troubleshooting menus with lots of those actions present with 1 key press
to do those actions, which I used very frequently every day.
Reply all
Reply to author
Forward
0 new messages