Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Matching over multiple lines in a scalar

by Rich36 (Chaplain)
on Oct 27, 2002 at 22:39 UTC ( #208391=note: print w/replies, xml ) Need Help??


in reply to Re: Matching over multiple lines in a scalar
in thread Matching over multiple lines in a scalar

Thanks for the help on this. By the way - just out of curiosity - why pass a hash reference to Data::Dumper instead of just the hash?


«Rich36»
  • Comment on Re: Re: Matching over multiple lines in a scalar

Replies are listed 'Best First'.
Re: Re: Re: Matching over multiple lines in a scalar
by BrowserUk (Pope) on Oct 27, 2002 at 22:51 UTC

    If you pass the hash, it gets flattened and passed as a list of 30 seperate scalars, the association between key=>value pairs is lost. By passing the reference, Data::Dumper knows it a hash, and outputs it as such, with the Key=>value pairs clearly associated and shown as being a part of a compound entity.

    In fact, you can then write this output to a file and then read it back, eval the string and it will recontruct the hash in memory. Often used as a cheap man DB.

    Run the program both ways to see the difference.


    Nah! Your thinking of Simon Templar, originally played by Roger Moore and later by Ian Ogilvy

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2021-04-14 20:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?