|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re: A brain twister? (how to make 2 lines->1)by muba (Curate) |
| on Jun 25, 2012 at 02:08 UTC ( #978103=note: print w/ replies, xml ) | Need Help?? |
|
I assume this is along the lines of what you were looking for?
Addendum: I've chosen to use single quotes for the output rather than double quotes, for the simple reason of keeping the output more or less copy/pastable (of course, copypastability gets lost as soon as a value is actually a reference, but if that is an issue I recommend something like Data::Dumper to you). Consider this template: And you were to put in the output of my above script, it'd nicely print 'three' => '3', 'one' => '1', 'foo' => '$foo', 'two' => '2', . Had I used double quotes for the output of the original script and pasted its result into the template, I would've gotten some bothersome errors.
Why are array so much easier to print out than hashes...geez...I beg to differ. Just remember to read elements in pairs.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||