[Linux][LibreOffice 6.4.5.2] Macro -- External Perl Script

Greetings !!

I’m a bit bored to seek for technical documentation that is a bit messy.
There is the description of my goals:

I’m seeking for a way to update in “real time” (without saving the document, run the script, and reopen again)
the sheets in Spreadsheet with sorted datas from two other sheets.

I got a perl script that sorts the datas… as I did not like nore VBA, nore javascript nore Python to do this in a macro.
The script works, I got what I wanted → the data sorted in the different sheets expected to display the sorted datas.

Now I try to trigger a macro each time my “main sheet” is modified.
I created a “sheet event” linked to the macro expected to be triggered (I debugged and saw that each time
I modify a cell the macro is triggered, that’s nice)

The problem is: the perl script seems to do nothing :{
I set the security to “medium” and set the “trusted folder” as the one where the script is located on my filesystem.

This is the code of the macro

Sub Main

REM APPELER UN SCRIPT PERL

Shell("/exemples/perl/tests/libreoffice/oodoc.pl",1,"",true)
REM Shell("/usr/bin/perl",1,"/exemples/perl/tests/libreoffice/oodoc.pl",true)
REM Shell("xterm",1,"/exemples/perl/tests/libreoffice/oodoc.pl",true)

REM TRY TO INDICATE THE TRIGGER IS DONE

Dim bTriggered AS Boolean
Dim mesFeuilles AS object
Dim maCellule AS object
Dim maFeuille AS object
Dim monDoc AS object

monDoc = ThisComponent
mesFeuilles = monDoc.Sheets
maFeuille = mesFeuilles.getByName("Calendrier")
maCellule = maFeuille.getCellByPosition(11,2)

if maCellule.Value = "" OR maCellule.Value = 0 Then 
	maCellule.Value = 1
End if
End Sub

I tried with “xterm” the “window” flashed and then vanished immediatly but that indicated the Shell() was executed.
My question is: why, the perl script is not showing the results as they were shown when executed
“outside” the LibreOffice application ?

Edited - because God is good ALL THE TIME!

I did not like perl but anyway i search for oodoc.pl and find this one and read there the script should be executed with an Argument /some/path/to/writer.odt … ? I dont see anything similar in your code!!

The reason is simple… the script perl works but I can’t launch it from a macro…

The only thing is: this perl application works only when the ods is closed…
It would be nice if there was a way to put some data on the sheets and then update them “real timely”
but for that I must be certain it is possible to run my perl application from a macro triggered when
we put some datas on another sheet.