arrays, multi-dimensional arrays, pointers and such 
Author Message
 arrays, multi-dimensional arrays, pointers and such

it there something that kinda resembles a pointer in perl?   if there
are, does anyone know how its used?
anyway, back to the jest of this post.  i am trying to write a cgi
script file that is to automatically generate a table based on the
directories present and the files located in that directory.  is there
anyway to implement that?  what i had in mind was to create a files
list, an array and a couple of lists.  the array would be used to hold
the names of the lists that are available.  the lists would kinda
contain the equivilent of java applet params, which just tells my script

file where the info will go in the table.  the main jest is to have the
web admin and any user that uploads files, to only modify the files list

and thats it. so it kinda looks like this

%doc1 = (
"title", "docuements table"
"wp5", "word perfect 5 document"
);

%doc2 = (
"title", "documents table"
"wp6", "word perfect 5 documents"
);

this is where i am stuck at.  i want to have a generic variable that


print "$temp{title}\n";
that hopefull will print out "documents table".  i know that i could do
it with the individual names of the lists, but i the problem is that if
i do that, when i add in new documentation i would have to manaully
modify the codes again.  the whole jest is not to do that.  so is there
any way that could be accomplished?  i know i could do it in c or
c++(pointers, and multi-dimensional arrays), but programming in c or c++

for a cgi script is kinda long and tedious and just a plain pain in the
ass.


any help would be greatly appreciated.  thanx

--
Ezekiel 25:17
"The path of the righteous man is beset on all sides by the inequities
of the selfish and the tyranny of evil men.  Blessed is he, who in the
name of charity and good will, shepherds the weak through the valley of
darkness, for he is truly his brother's keeper and the finder of lost
children.  And I will strike down upon thee with great vengence and
furious anger those who attempt to poison and destroy my brothers.  And
you will know my name is the Lord when I lay my vengence upon thee."

        -Jules, Pulp Fiction



Sun, 03 Jun 2001 03:00:00 GMT  
 arrays, multi-dimensional arrays, pointers and such
[posted & mailed]

Quote:

> it there something that kinda resembles a pointer in perl?  

Yes, references.  They are documented in perlref.  Other related
documents are perldsc and perllol.

Quote:
> if there are, does anyone know how its used?

They wouldn't be very useful if no one knew how to use them.  :-)

Quote:
> anyway, back to the jest of this post.  i am trying to write a cgi

                      ^^^^
I thought the last question was it.

Quote:
> script file that is to automatically generate a table based on the
> directories present and the files located in that directory.  is there
> anyway to implement that?  what i had in mind was to create a files
> list, an array and a couple of lists.  the array would be used to hold
> the names of the lists that are available.  the lists would kinda
> contain the equivilent of java applet params, which just tells my
> script file
>  where the info will go in the table.  the main jest is to have the
> web admin and any user that uploads files, to only modify the files

> list and thats it. so it kinda looks like this

> %doc1 = (
> "title", "docuements table"
> "wp5", "word perfect 5 document"
> );

> %doc2 = (
> "title", "documents table"
> "wp6", "word perfect 5 documents"
> );


> this is where i am stuck at.  i want to have a generic variable that
> will hold a reference to one of the lists.


> print "$temp{title}\n";


    $temp     = $docType[0];
    print "$temp->{title}\n";

perldsc will definately be of use to you.  Check out the section, 'LISTS
OF HASHES'.

--
Rick Delaney



Mon, 04 Jun 2001 03:00:00 GMT  
 arrays, multi-dimensional arrays, pointers and such
 [courtesy cc of this posting sent to cited author via email]


:it there something that kinda resembles a pointer in perl?  

    man perlref
    man perllol
    man perldsc

--tom
--
    "All things are proceeding rapidly to their contusion." --Larry Wall



Mon, 04 Jun 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. sorting multi-dimensional arrays, or pointers in perl

2. Associative arrays and multi-dimensional arrays.

3. Multi-Dimensional arrays, DBMs, and Assoc. Arrays

4. Extracting an array out of a multi-dimensional associative array

5. 2-dimensional array into 1 dimensional array?

6. Multi-dimensional arrays.

7. multi-dimensional arrays in Perl 5

8. Multi dimensional arrays

9. Multi-Dimensional Arrays

10. Multi-dimensional arrays

11. MULTI-DIMENSIONAL Arrays

12. Multi-dimensional arrays

 

 
Powered by phpBB® Forum Software