vishi83 has asked for the wisdom of the Perl Monks concerning the following question:
hi great ppl !!1
Look this,$VAR1 = { 'id' => { 'Extra' => 'auto_increment', 'Type' => 'int(11)', 'Field' => 'id', 'Default' => undef, 'Null' => '', 'Key' => 'PRI' }, 'name' => { 'Extra' => '', 'Type' => 'varchar(50)', 'Field' => 'name', 'Default' => '', 'Null' => '', 'Key' => 'UNI' } };
It must be clear that i'm printing this hash ref with a dumper ..
I dint give my code, coz i hav used lot of my own modules in that .. so thot it would be little confusing to all ...
I hav generated this hash from a db table ...For this i have written a method ('fetchit')...
this method is used like this..
so this method will return the table desc as a hash..$hashref = $object->fetchit($tablename);
NOw i got struck in one thing.. please help me in this..
I want to print only the FIELD names present inside that hash.. here the field names are id and name ..
How can i do that ??? .. please help me
Thanks in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get the Keys in the Hash
by Corion (Patriarch) on Nov 05, 2005 at 15:36 UTC | |
|
Re: Get the Keys in the Hash
by Trix606 (Monk) on Nov 05, 2005 at 15:18 UTC |