Perl question

George Daflidis-Kotsis gdk at demon.net
Mon May 14 15:41:01 EEST 2001


On Mon, May 14, 2001 at 02:37:11PM +0300, Kekes Stamatis wrote:

> Otan kano ena loop kai tou leo na mou typosei ta periexomena tou pinaka mou typonei
> ARRAY(0x82499cc). Why that ??
> 
> 
>  Idou o kodikas pou to paragei :
> 
> my @ll=$result[0];
> %opts=( map {$_ => $_ } @ll );
> foreach $ll ( @ll )
> {
>         print $opts{ $ll },$cgi_class->p,"\n";
> }
> 
> kai o pinakas result exei gemisei apo tin doquery pou mou epistrefei enan
> disdiastato pinaka pou ksero oti to mideniko stoixeio einai to apotelesma pou thelo.

Otan kaneis to print me ton diko sou tropo, de sou tupwnei to value pou
antistoixei sto sugkekrimeno key pou zhthses alla to address ths mnhmhs opou
einai apo8hkeumeno to value.

Genika kaneis kati san:

foreach $ll (keys %opts) {
  print $opts{$ll}, $cgi_class->p, "\n";
}

Filika.

-- 
[george daflidis-kotsis - systems admin,web/e-commerce - gdk at demon.net]
["I grow old always learning" - "I know one thing that I know nothing"]



More information about the Linux-greek-users mailing list