[sf-perl] Dump Perl ? (fwd)

Matthew Lanier matt at cloudfactory.org
Fri Sep 29 19:26:11 PDT 2006


any takers?

m@
-- 

---------- Forwarded message ----------
Date: Fri, 29 Sep 2006 16:43:23 -0700
Subject: Dump Perl ?

Hiya,

Got a function that parses data structures. For debugging and stuff.

How do I find/print the "name" of the data structure?

parseStuff($array_ref, $hash_ref1, $hashref2);

sub parseStuff {
   use Data::Dumper;
   foreach my $structure(@_) {
     print "you're looking at a data structure named [?]\n";
     print "and it looks like: " . Dumper($structure) . "\n";
   }
}

And then I want it to tell me "array_ref" and spew its contents, then 
"hash__ref1", etc., for an arbitrary number of arbitrarily named data 
structures.

TIA,

-Ben


More information about the SanFrancisco-pm mailing list