Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: pushing hash values to an array

by valavanp (Curate)
on Oct 16, 2006 at 12:13 UTC ( #578478=note: print w/ replies, xml ) Need Help??


in reply to Re: pushing hash values to an array
in thread pushing hash values to an array

I am getting the hash reference values from the database through the keys of the hash values. I have a record with 3 fields in my backend. When i am retrieving the record with a particular field I am getting displayed only the number of fields, not the contents of the field which is 1,13 in this case(which are the actual values of the field). I am using these values in an combox box of a CGI application web page for multiple selection of an item. Only when i am pushing that hash values it is not getting displayed. In other areas, like retrieving rows it works fine. Please suggest me how can i proceed. I thank you for your suggestions.


Comment on Re^2: pushing hash values to an array
Re^3: pushing hash values to an array
by wfsp (Abbot) on Oct 16, 2006 at 12:21 UTC
    hi valavanp,

    When you're not sure what sort of variable you have I find it useful to use Data::Dumper. When you know what is actually in it you have a better chance of extracting the data.

    Show us the output of Data::Dumper and we'll be able to offer more help.

Re^3: pushing hash values to an array
by blazar (Canon) on Oct 16, 2006 at 13:40 UTC

    I still have some problems parsing your text. I understand that English may not be your mother tongue, it's not mine either. I feel like suggesting you to concentrate on the (possibly ) few relevant points with your issue and ignore anything else that may contribute the the noise/signal ratio of your post.

    I am getting the hash reference values from the database through the keys of the hash values.

    Ok, you have a hashref, period. You want to push its values into an array, right? Then the suggestion I gave you in my other reply should be fine. Did you try it? Does it work? Any inconvenience with it? Or else you may directly dereference the hashref as a whole and combine the two mentioned functions in one sweep:

    push @array, values %$hashref;
    I have a record with 3 fields in my backend.
    [...]

    Snip!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://578478]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2014-10-01 19:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (38 votes), past polls