[Programación] Re: [Programación] Re: [Programación] Este e jemplo en perl no anda... (de la conferencia )?=

Horacio Castellini programacion@lugro.org.ar
Sun, 31 Jul 2005 20:17:07 -0300 (ART)


Chas gracias....

> Se ve que es un pequeño bug...
> 
> foreach $i (keys %h1){
>         print "$h1{$i} \n";  #en el ejemplo era: 
> %h1{$i}, cambiamos el % por el $
> }
> 
> Como uno está refiriéndose a un escalar dentro del
> hash hay que usar $ 
> ante el array, en vez del % que se refiere al hash
> por si mismo.
> 
> Saludos,
>              Nicolás.
> 
> 
> 
> Horacio Castellini wrote:
> 
> >Hola...
> >
> >Con ánimo de aprender perl al estilo el autodidacta
> tucumano "Ramon 
> >Ortega" (viejo el chiste... ) decidí comprobar este
> ejemplo del apunte de 
> >pepe... 
> >--------------------------------------
> >#!/usr/bin/perl
> >
> >@a=(1,2,3,4,5);
> >foreach $i (@a){ 
> >        print "$i "; 
> >}
> >print "\n";
> >
> >%h1=(Nombre=>'Horacio',Apellido=>'Castellini');
> >foreach $i (keys %h1){
> >        print "%h1{$i} \n";
> >}
> >---------------------------------------
> >
> >Pero el hash me da este indeseable resultado...
> >
> >1 2 3 4 5 
> >%h1{Apellido}
> >%h1{Nombre}
> >
> >Según el apunte de José debería aparecer 
> >
> >Castellini
> >Horacio
> >
> >Pero, nop...  Un bug... ??
> >
> >_______________________________________________
> >Programacion mailing list
> >Programacion@lugro.org.ar
>
>http://www.lugro.org.ar/mailman/listinfo/programacion
> >
> >  
> >
> _______________________________________________
> Programacion mailing list
> Programacion@lugro.org.ar
>
http://www.lugro.org.ar/mailman/listinfo/programacion
> 



	


	
		
___________________________________________________________ 
1GB gratis, Antivirus y Antispam 
Correo Yahoo!, el mejor correo web del mundo 
http://correo.yahoo.com.ar