El dijous, 09 de maig del 2013 a les 14:53, Thomas Adam va escriure:

> On 9 May 2013 14:40, mimosinnet <mimosin...@gmail.com> wrote:

<code>

> 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

Looks like there is still lots to learn! I will get acquainted with the
map and join. Meanwhile, I have updated the information in the fvwm
forums:

- http://www.fvwmforums.org/phpBB3/viewtopic.php?f=33&t=2970&p=14185#p14185 
- And mentioned in the awesome wiki about the possibilities of Perl
  preprocessing: 
  
http://awesome.naquadah.org/wiki/Keybindings_and_numeric_pad#Having_all_together_in_few_lines_of_code.21.21

Thanks!

-- 
Mimosinnet
Linux User: #463211
41:24:51N (41.4141) 2:11:24E (2.1902)

Ningún Lugar
Activisme Cultural per a la Transformació Social
http://generatech.org/ningunlugar

Fractalitats en Investigació Crítica
Investigació Crítica per a la Transformació Social
http://psicologiasocial.uab.es/fic

Attachment: pgpzUbhpzn23L.pgp
Description: PGP signature

Reply via email to