KJG > Your '($clave,%valor) = each %ifconfig' statement doesn't work as you
   KJG > expect. 'each' will only EVER return two scalars. You need to first capture
   KJG > the scalar and THEN dereference it in the 'clave2/valor2' loop. So with two
   KJG > changes to your code you're closer to your goal:
   KJG >
   KJG >   no strict;
   KJG >   use warnings;
   KJG >
   KJG >   use Getopt::Long;
   KJG >
   KJG >   my %ifconfig=();
   KJG >   GetOptions(\%ifconfig, "set=s%");
   KJG >   while (($clave,$valor)= each %ifconfig){
   KJG >      print "\t$clave\t->\n";
   KJG >      while (($clave2,$valor2)=each %$valor){
   KJG >         print "\t\t$clave2\t->\t$valor2\n";
   KJG >      }
   KJG >   }
   KJG >
   KJG > Note: this still requires multiple '--set' options, which is not what you
   KJG > originally asked for. Ie. you still have to call:
   KJG >
   KJG >   perl command.pl -s a=1 -s b=2
   KJG >
   KJG > And you can't just call
   KJG >
   KJG >   perl command.pl -s a=1 b=2
   KJG >
   KJG > Fact is that Getopt::Long is written to reproduce common command line option
   KJG > formats, and your format is not a common one, so as Randy demonstrates, you
   KJG > may need to write your own handler.

OK, that explains... I was really confused. Now I get it.


Thanx evreryone!!


Regards,
m4c.


__________________________________________________________
Marcos Lorenzo de Santiago (Labs Technician)

Departament of Telematic Engineering
University Carlos III Av.Universidad 30 Legan�s (Madrid).
Torres Quevedo Building 4.1A01

E-mail:   [EMAIL PROTECTED], Telephone: (+34)91-624-8757
Homepage: http://www.it.uc3m.es/marcos
__________________________________________________________

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to