#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    USA
    Posts
    67
    Rep Power
    15
    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. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Southern California
    Posts
    73
    Rep Power
    15
    <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).]

IMN logo majestic logo spyfu logo threadwatch logo seochat tools logo