[Boston.pm] Data::Dumper formatted for linked lists?

2013-02-08 Thread Greg London
Is there a module out there for dumping linked lists in a legible manner? I like that Data::Dumper gives you an output that can be evaled back in, but when you give it a linked list, it gives you an output that's totally unreadable. ___ Boston-pm

Re: [Boston.pm] Data::Dumper formatted for linked lists?

2013-02-08 Thread Jordan Adler
Not sure what you mean by linked lists -- the traditional concept of that data structure doesn't really exist in Perl. Generally, though, I would recommend YAML for more human-readable data serialization. It has excellent features for pointers/references without being verbose. It also has the

Re: [Boston.pm] Data::Dumper formatted for linked lists?

2013-02-08 Thread Morse, Richard E.MGH
There are alternatives to Data::Dumper -- I personally like Data::Dump, but there seem to be a lot of modules in that space. In particular, I've seen recommendations for Data::Dump::Streamer, and if you don't need to be able to re-eval it, you could look at Data::Printer. HTH, Ricky On Feb 8,

Re: [Boston.pm] Data::Dumper formatted for linked lists?

2013-02-08 Thread Duane Bronson
I'm not sure how it can be done generically because there is no generic linked list structure in perl, right? There is an array, though, so convert to an array and then use data dumper. if the array is in the reverse order, Data::Dumper will indicate it's already printed the next portion and

Re: [Boston.pm] Data::Dumper formatted for linked lists?

2013-02-08 Thread Chris Devers
I'd advise reading this: http://www.kalzumeus.com/2013/01/31/what-the-rails-security-issue-means-for-your-startup/ Then think real hard about if YAML is the way to go for *anything* right now. The current problem is with Ruby, but it seems plausible that other languages could be affected as

Re: [Boston.pm] Data::Dumper formatted for linked lists?

2013-02-08 Thread Ron Newman
On Feb 8, 2013, at 12:33 PM, Chris Devers wrote: I'd advise reading this: http://www.kalzumeus.com/2013/01/31/what-the-rails-security-issue-means-for-your-startup/ Then think real hard about if YAML is the way to go for *anything* right now. The current problem is with Ruby, but it

Re: [Boston.pm] Data::Dumper formatted for linked lists?

2013-02-08 Thread Greg London
I'm not sure how it can be done generically Well, this is what I have for dumping a linked list where the element is an array. [0] is payload. [1] is next. [2] is prev: sub DumpLLArray{ my($element, $next,$prev)=@_; $next=1 unless(defined($next)); $prev=2