Re: FVWM: Arithmetics?

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Tue, 22 Apr 2003 20:50:24 +0000

On 22 Apr 2003 21:59:54 +0200, Felix E. Klee wrote:
>
> One more question: Why does the following line procude a syntax error (I'm
> using 2.5.6 and the corresponding definition for ".")?
> . Echo %{ if ( 5 > 4 ) { return 5; } else { return 6; } }%
>
> I also tried
> SendToModule FvwmPerl eval if ( 5 > 4) { command("Echo 5"); } else {
> command("Echo 6"); }
> and this works.

Both work for me. :)

Ah, yes, this is because you run old fvwm versions and use the q<$*>
syntax in the "." function definition. Replace it with q~$*~, then you
can use ">" but not "~" in your commands.

I really suggest to use run latest snapshot instead and use the syntax
for the "." function that has no such problems.

BTW, you may always omit "return" in perl, the result of the last
expression is used. This is the equivalent of your command:

  . Echo %{ 5 > 4 ? 5 : 6 }%

Regards,
Mikhael.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Tue Apr 22 2003 - 15:52:16 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:54 BST