Re: print_r in Perl

2006-02-24 Thread Bob Showalter
Johannes Ernst wrote: I realize why it does that. I'm asking whether I can have something higher-level that works for objects on the abstraction level where one usually looks at an object. Data::Dumper is designed to produce Perl source code that can be eval'd to reconstruct the object. So

print_r in Perl

2006-02-23 Thread Johannes Ernst
PHP knows print_r -- which prints a data structure hierarchically, and is very useful for debugging. e.g. echo Variable a is . print_r( $a, true ) . \n; Is there something similarly easy in Perl? It appears that Data::Dumper may be of help, but I have not been able to figure out how to

Re: print_r in Perl

2006-02-23 Thread Octavian Rasnita
From: Johannes Ernst [EMAIL PROTECTED] PHP knows print_r -- which prints a data structure hierarchically, and is very useful for debugging. e.g. echo Variable a is . print_r( $a, true ) . \n; Is there something similarly easy in Perl? It appears that Data::Dumper may be of help,

Re: print_r in Perl

2006-02-23 Thread Johannes Ernst
That just changes the amount of whitespace. Here is an example of what I want: Some::Package { a = 'a value', b = 12, c = Other::Package { x = 34 } } instead of what Data::Dumper gives me, which seems to be: p is $VAR1 = bless( [ bless( { 'c' = 3, 'a' = 1,

Re: print_r in Perl

2006-02-23 Thread Johannes Ernst
I realize why it does that. I'm asking whether I can have something higher-level that works for objects on the abstraction level where one usually looks at an object. P.S. I would know, because it would say HASH instead of Some::Package. On Feb 23, 2006, at 22:42, Octavian Rasnita wrote: