If you would like to have a graphical browser for perl structures, it's easy:

- install package Tk

- install package Tk::ObjScanner

- run the demo below

#!perl -w # This demo of Tk-ObjScanner # is a stripped-down version of the test file Tk-ObjScanner\t\basic.t # The module Tk::ObjScanner by Dominique Dumont is available on CPAN a +nd on PPM use strict ; package Toto ; # creates a moderately complicated perl structure sub new { my $type = shift ; my $tkstuff = shift ; my $scalar = 'dummy scalar ref value'; open (FILE,"$0") || die "can't open myself !\n"; my $glob = \*FILE ; # ??? my $self = { 'key1' => 'value1', 'array' => [qw/a b sdf/, {'v1' => '1', 'v2' => 2},'dfg'], 'key2' => { 'sub key1' => 'sv1', 'sub key2' => 'sv2' }, 'some_code' => sub {print "some_code\n";}, 'piped|key' => {a => 1 , b => 2}, 'scalar_ref_ref' => \\$scalar, 'filehandle' => $glob, 'empty string' => '', 'non_empty string' => ' ', 'long' => 'very long line'.'.' x 80 , 'is undef' => undef, 'some text' => "some \n dummy\n Text\n", 'tk widget' => $tkstuff } ; bless $self,$type; } package main; use Tk ; use Tk::ObjScanner ; my $mw = MainWindow-> new ; my $dummytolookat = new Toto ($mw); $mw -> ObjScanner ( 'caller' => $dummytolookat, #destroyable => 0, title => 'test scanner' ) -> pack(expand => 1, fill => 'both') ; MainLoop ; # Tk's
Both packages are available from CPAN or from PPM (Active State)

Rudif


In reply to Re: print_r or var_dump? by Rudif
in thread print_r or var_dump? by simeon2000

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.