On 9 May 2013 14:40, mimosinnet <mimosin...@gmail.com> wrote:
> ~/.fvwm/config.pl
> --------------------
> key i   A C     Exec exec xmessage -nearmouse "No preprocesing"
> %{ $b = "Preprocessing"; $a = "key i A S Exec exec xmessage -nearmouse $b"; 
> $a }%
>
> %{
> @a = ("KP_Home", "KP_Up", "KP_Prior", "KP_Left", "KP_Begin", "KP_Right", 
> "KP_End", "KP_Down", "KP_Next" );

I appreciate this is likely in the examples, but the use of @a/@b and
$a/$b should be discouraged because these are special variables in
perl which are used for block-level commands like sort/map/grep.
Also, see the use of qw here for your @a array, above.

> $i = 0;
> $b = "";
> foreach (@a ) {
>         $b = $b . "Key $_ A N  Exec exec xmessage -nearmouse $i \n";
>         $i = $i +1;
> }
> $b

You can get the same effect by doing:

$i = 0; $foo = join ("\n", map { "Key $_ A N Exec exec foo -nearmouse
" . $i++ } @a );
$foo

-- Thomas Adam

Reply via email to