nevermind, 2 minutes after i posted this, i saw what i was doing wrong:
when referencing arrays you need to do this:
Code:
$ref_array = \@array
INSTEAD OF
Code:
@ref_array = \@array
Sorry for the double post,
basically a good way to think about pointers or reference in perl is to think that pointers are a special kind of scalar.
So when initalizing a pointer you need create a "special scalar". However pointers can be of two things in perl. One is a regular reference like in C. and another kind of reference is an anonymous copy. An Anonymous is hte same as a regular reference but instead of indirectly referencing the value it makes a copies of value.
For example:
A reference declaration:
Code:
$ref_array = \@array or $ref_var = \$i;
anonymous copy is alittle different
Code:
$ref_array = [@array] ; like so wiht a scalar
and to deference your pointer you can do:
Code:
print "Deference $$ref_array[$i] \n";
this works both for reference and anonymous copies also.
hope this helps!!! this is a good way to create mult-dimenisonal arrays.. for more information about pointers and reference you can go here
http://linux.skavt.net/teach_perl_in_21days/ch18.htm
thanks,
djgerbavor3