Hi Japhy,

wow, itīs been only the my %values declared outside the loop... But why has it to be 
declared inside, i thougt its "global" if I use it outside? Isn,t it?

The Solution without %values at all is also pretty cool! Thanks!

>my %values = ( tstamp => $tstamp, ... );

This seems to be also OK like my %values=( tstamp=>$tstamp,... ); since the script 
works if I change only the declaration inside the loop... But I am not shure so I īll 
change it.

If the DBI offers that out off the box i donīt know, always used fetchrow_array... 
Iīll have a look at it...

Thank you so far... 

Johannes

>i just got stuck with hashes, hashes of hashes and referenzes... I know i
>have to study a bit about all of that... :-( So i hope theres somebody
>who can tell me the way (or direction...) :-)

>my %values;

This should be declared INSIDE the while loop below:

>while (my ($tstamp,$serial,$retests,$passfail)=$sth-> fetchrow_array){

>  %values=();
>  %values=(tstamp=>$tstamp,serial=>$serial,retests=>$retests,passfail=>$passfail);

This should read:

  my %values = ( tstamp => $tstamp, ... );

>  print "$values{tstamp} $values{serial} $values{retests} $values{passfail}\n";
>  $test_timestamp{$tstamp}=\%values;
>  print "$test_timestamp{$tstamp}{tstamp}\n";
>}

In fact, you can do without %values at all:

  $test_timestamp{$tstamp} = {
    tstamp => $tstamp,
    serial => $serial,
    ...,
  };

But doesn't DBI over a fetchrow_hashref method that basically DOES this?

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to