It's tough to say from the code you have here.  Have you tried printing out
$i, $key and all of $model to make sure they all have the values you expect?
I would run this through perl with the -d option to watch the values as they
change.  If you haven't used the perl debugger before it's not hard and very
useful.  You can just use 's' to step through and 'p $someVar' to print out
variable values.

If you can post some more code, like what @model is, I might be able to help
a bit more.

Peter C.

> Thank you for your very useful response. It seems to have 
> addressed the
> @data problem but I'm still having a problem with $model[$i] 
> not printing or
> holding a value. 
 
> 
> >This is the code that fails me:
> >  
> >               $i=0;
> >           for $fields(split /&/, @data) {         
> >               ($key, $value) = split /=/, $fields;
> >               $bigData{$model[$i]}{$key} = "$value";
> >               $i++;
> >           }
> >  
> > It won't print out @data or @model from anywhere inside the 
> > for loop and
> > won't print out specific dereferencing like "$bigData{307}{Price}. 
> >  
> > Any ideas anyone?
> 
> Hmmm.  I think split takes a string, or expression that evaluates to a
> string, in its second argument.  That would mean that @data is being
> evaluated in a scalar context.  When you evaluate an array in 
> scalar context
> you get the size, so you end up only looping once and only 
> operating on an
> integer (because the split would return the whole string since '&' is
> nowhere in it).  You could probably do this my nesting this in another
> loop...
> 
>         for $datum (@data) {
>                $i=0;
>            for $fields(split /&/, $datum) {         
>                ($key, $value) = split /=/, $fields;
>                $bigData{$model[$i]}{$key} = "$value";
>                $i++;
>            }
>         }
> 
> I haven't run this so be ware.

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

Reply via email to