LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] [OT] perl question...

[ILUG] [OT] perl question...

Niall O Broin niall at linux.ie
Thu Jul 15 12:35:56 IST 2004


On Thursday 15 July 2004, Declan.Grady at nuvotem.com (Declan Grady) wrote:


>I have two arrays,  @openitems, and @customernames.
>I need to create a new array which will take all the openitems, and lookup
> a customer name in the @customernames array, based on the customercode,
> which is common to both arrays.
>
>i.e.
>@openitems is:
>code, type, value, date, ref, ... etc
>
>@customernames is:
>code, name

Arrays are lists, indexed by number. So what exactly do you have as the
contents of your arrays - comma separated strings? references to something
else (I doubt this, but . . .)?  i.e. how are you storing in @openitems all of
code, type, value, date, ref, ... etc  because an array has only an index, and
a value - but that value can be a string, which you can be parsing to get
those things, or a reference to a has, or  . . .

>I guess its something to do with a hash, but I guess I dont fully 
>understand how that works.

Hashes are like arrays, but instead of being indexed by a number, they are
indexed by a string. Probably the answer to your problem does involve the use
of hashes.




Niall



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell