FvwmPerl and preprocessing commands error

I’m trying to play around with FvwmPerl, so see if I can use it for my config files, but haven’t gotten anything to work as yet.

I’ve been testing in the FvwmConsole
I issue the command

ModuleSynchronize FvwmPerl

And create the function

AddToFunc .
       + I SendToModule FvwmPerl preprocess -c -- $*

The problem is, the preprocessing examples in the man page don’t work

 . Exec exec xterm -name xterm-%{++$i}%

I get the following message in my .xsession-errors

Unescaped left brace in regex is passed through in regex; marked by ← HERE in m/% { ← HERE ( .*? ) } %/ at /usr/local/libexec/fvwm3/1.0.7/FvwmPerl line 324.

Or, the examples seem to do nothing, on output, nothing on .xsession-errors

I’m using
fvwm3 1.0.7 (1.0.6a-16-g4ef39533)
with support for: ReadLine, XPM, PNG, SVG, Shape, XShm, SM, Bidi text, XRandR, XRender, XCursor, XFT, NLS

on Fedora 37.

Maybe I’m missing something obvious, or doing it all wrong, but basically, I want to know how I can get started using perl to do arithmetic in my config files

With a little trial and error, I’ve found a couple of things…

1: ModuleSynchronize doesn’t appear in the Fvwm3 man page. It also doesn’t seem to appear in the Fvwm man page for version 2.6.8.
I issued the command ModuleSynchronous FvwmPerl
instead. This seems to work and loads the module. ModuleSynchronize FvwmPerl doesn’t start the module, yet this appears in the FvwmPerl man page.

2: Instead of + I SendToModule FvwmPerl preprocess -c -- $*
I used + I SendToModule FvwmPerl preprocess -c $*

leaving out the double hyphen. From the FvwmPerl man page, I couldn’t work out why the double hyphen needed to be there, or at least, what function it serves.

These two changes (ModuleSynchronize to ModuleSynchronous) and removing the double hyphen seemed to make things work. I now get the expected behaviour. Does this mean the documentation is out of date?

The following config file is for my version of Fvwm3 a working example.


ModuleSynchronous FvwmPerl

DestroyFunc .
AddToFunc .
+ I SendToModule FvwmPerl preprocess -c $*

DestroyFunc Test1
AddtoFunc Test1
. + I Exec xmessage %{2 + 2}%
# Prints a xmessage box with 4

DestroyMenu TestMenu
AddToMenu TestMenu "My Test Perl Menu" Title
SendToModule FvwmPerl eval $a = $ENV{HOME} . "/Download" ;opendir DIR, $a; @b = grep { /png$/ } readdir(DIR); closedir DIR
SendToModule FvwmPerl eval foreach $b (@b) { command("AddToMenu TestMenu '$b' Exec  sxiv $a/$b")}

#With Popup TestMenu I get a menu of the png files which I can open.
SendToModule FvwmPerl stop