Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-20-2006, 08:35 AM   #1
Registered: Aug 2005
Location: Montréal
Distribution: Debian Testing, Slackware 10.2
Posts: 136

Rep: Reputation: 15
type of list element in Perl ?


I wonder if it's possible to know the type of a list element, i.e. is it a scalar or a list reference or a hash reference ?

My initial problem is to implement a data structure for three kinds of "phenomena" - word, optional word and alternative word. I think to use a list containing scalars for words, references to lists for optional words and references to hashes for alternatives.

Thank you in advance.
Old 06-20-2006, 08:45 AM   #2
spirit receiver
Registered: May 2006
Location: Frankfurt, Germany
Distribution: SUSE 10.2
Posts: 424

Rep: Reputation: 33
try "ref( $reference )".
Old 06-20-2006, 08:49 AM   #3
Registered: Aug 2005
Location: Montréal
Distribution: Debian Testing, Slackware 10.2
Posts: 136

Original Poster
Rep: Reputation: 15
Exactly what I'm looking for (should've thought it with my head...).


Perl is really great...

Originally Posted by spirit receiver
try "ref( $reference )".


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Could not init font path element unix/:7100, removing from list! jeffreybluml Fedora 18 10-12-2011 08:06 AM
"array type has incomplete element type" compiling 2.4.32 kernel Akabaka Linux - General 1 01-08-2006 12:48 PM
list<type> how can I make type be a pointer? exodist Programming 2 06-06-2005 08:40 AM
arrays of elements with [gcc4]array type has incomplete element type lmmix Linux - Software 0 02-26-2005 08:07 AM
Inserting element to a list of list in C suwandy_chandra Programming 2 03-09-2004 03:08 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:47 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration