in reply to Re: Re: Matching over multiple lines in a scalar
in thread Matching over multiple lines in a scalar
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.
|
---|