Data Structures in PERL

  • Thread starter Roman Rodriguez
  • Start date
R

Roman Rodriguez

Can you use PERL to create data structures such as linked list? if so, is
there maybe a link where this can be studied?

Thanks,
-RR
 
T

Tad McClellan

Roman Rodriguez said:
Can you use PERL to create data structures such as linked list?


You are expected to check the Perl FAQ *before* posting to the
Perl newsgroup you know.

perldoc -q linked

How do I handle linked lists?
 
P

Paul Lalli

Roman Rodriguez said:
Can you use PERL to create data structures such as linked list? if so, is
there maybe a link where this can be studied?

(Perl. Not PERL. See: perldoc -q difference)

You *can*, but you don't want to. Perl's native arrays are already more
powerful than linked lists. This simple question smells like an XY
problem. You need to do X, and you've decided based on programming in
other languages that the way to do X is with a linked list (Y). So
you're asking us how to do Y intead of how to do X.

What is it you actually want to do?

To answer the question you (sort of) asked, a description of Perl
datastructures - hashes, arrays, arrays of array references, etc, are
discussed in:
perldoc perldsc

Paul Lalli
 
C

ctcgag

Roman Rodriguez said:
Can you use PERL to create data structures such as linked list?

Yes, you can. But you rarely will want or need to.
if so,
is there maybe a link where this can be studied?

What is your goal? If you want to learn about linked lists, then
it probably isn't so relevant what language you use, so I'd just take
whatever language the tutorial you find happens to use. If your goal
is to learn perl, I'd choose something other than linked lists as the foil
for doing so. That said,
perldoc -q linked
should be enough to start you off exploring linked lists in Perl.

Xho
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top