SPUG: Variation on a dumb newbie question

davec davec at linuxstart.com
Fri Sep 24 00:27:27 CDT 1999


> 2. No, %count contains both the keys and the values. I don't have perl up
> and running right now, but here's something you can do to try and get a
> feel for how associative arrays are structured:
>
> @foo = %count;
> print @foo;
>
> You'll see both the keys and values (they won't look pretty though). Now if

you can also:

    print "@foo";

and the elements of the array will be separated by spaces.

Or more perversly

    printf "%s: " x ($#foo+1), at foo;             
------
Do you do Linux? :)
Get your FREE @linuxstart.com email address at: http://www.linuxstart.com

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
        Email to majordomo at pm.org: ACTION spug-list your_address





More information about the spug-list mailing list