On Monday 30 July 2001 12:05, Matija Papec wrote:
> Program below works fine but I wander how to optimize this; it looks very
> ugly. The final result have to be @data which contains two arrays. First
> array have to be equal size of second array(@datumi2) and all their values
> have to be "".

Hmmm, this isn't working for me - at least not the way you describe it.  What 
I see you saying is that you want an array (@data) to contain references to 
two other arrays.  Each of the arrays referred two must have the same number 
of elements; in one array you'll have numbers ( 1..100 in your example ) and 
the other containing the same number of elements all of which are equal to 
"".  

When I run your program with Data::Dumper, I get the following (I'm only 
doing a few elements for this illustration):

$VAR1 = [
          [],
          [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10
          ]
        ];

which indicates that the first array is empty.  The problem is the undef of 
@temp.  What you've put into @array is a reference to @temp.  When you undef 
it, you're undefing the array that the reference in array points to.

In any event, I can't figure out why you'd want to do what I think it is 
you're trying to do. There certainly may be a vaild reason for it, but there 
may be a better solution.

Can you say what it is you're trying to accomplish?

Regards,

Troy Denkinger





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

Reply via email to