|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
i have written a class in the form of a hash. inside of that class, i have an array.
how would i print out the contents of that array? how would i modify 1 element of the array? thanks in advance |
|
#2
|
||||
|
||||
|
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by bydavid:
i have written a class in the form of a hash. inside of that class, i have an array. how would i print out the contents of that array? how would i modify 1 element of the array?[/quote] I assume that you mean you have a data structure like this: $hash = { item => [ 'arrayitem1', 'arrayitem2' ] }; To get a list of values for array 'item', you could use: @vals = @{$hash->{item}}; To modify it, do this: $hash->{item}->[0] = 'this'; Hope this helps... [This message has been edited by vpopper (edited June 27, 2000).] |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > accessing members of a class |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|