Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
Don't ask to ask, just ask
 
PerlMonks  

Re: Complicated Nested Data Structures

by jlp (Friar)
on Aug 09, 2000 at 01:58 UTC ( [id://26924]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Complicated Nested Data Structures

I'm not sure I understand the question. Do you want to print the datastructure itself, or the data it contains? If you want to print a representation of the datastructure, use Data::Dumper:

use Data::Dumper; my $structure = [ 'complex', { data => 'structure' } ]; print Dumper($structure);

Replies are listed 'Best First'.
RE: Re: Complicated Nested Data Structures
by elusion (Curate) on Aug 09, 2000 at 02:13 UTC
    Sorry, I tend to think a little different than most people and assume the wrong things. That line of code assigns a reference to an array which contains an email message. I want to be able to print that. I hope that makes more sense.

    - p u n k k i d
    "Reality is merely an illusion, albeit a very persistent one." -Albert Einstein

      Gotcha. No problem :) If all you want to do is print the contents of an array reference, just do:

      print @{ $arrayref };

      So, in your example, all you should have to do is:

      print @{ $msgs[$command]->{message} }

      assuming I understand the way your datastructure is setup. Hope that helps.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://26924]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.