[ic] session dump

johny brabo schurkmaster@yahoo.com
Sun, 1 Apr 2001 15:02:31 -0700 (PDT)


Some time ago I got a perl file from 
Christopher F. Miller that should dump my session
and show much of my data structure.
http://developer.akopia.com/archive/interchange-users/2001/msg01215.html

I am now working on this, but I can't get this to
work.
using it as an interchange page doesn't work nor does
running it as a standalone perl script.
What should I do?

thanks.

the code:

#!/usr/bin/perl
# sessiondump.html
# rev 2000-12-21, cfm for perl 5.6 ref
[tag op=header]
Content-Type: text/plain
[/tag]
[realperl]
{
    my(@OUT,@foo,$i,$test,$what);	
    @foo=["Vend::",''];
    $i=0;
    while($what = shift @foo) {
	my($x);
	$test = $what->[0];
	unless($what->[0] =~ /->/ || $what->[0] !~ /::$/) {
	    for (sort keys %{eval "*$what->[0]"}) {
		unshift @foo, ["$what->[0]$_",$what->[1].'	'];
	    }	
	}
	$what->[0]=~s/::$//;
	$x=eval "\$$what->[0]";
	push @OUT, qq`$what->[1]$what->[0] - ${\(eval
"\$$what->[0]")}\n`;
	
	if(ref($x) eq "HASH") {
	    for(sort keys %{$x}) {
		unshift @foo, ["$what->[0]\->{'$_'}","$what->[1]	"];
	    }
	    next;
	}
	if(ref($x) eq "ARRAY") {
	    for(my $i = 0; $i < @{$x}; $i++) {
		unshift @foo, ["$what->[0]\->[$i]","$what->[1]	"];
	    }
	    next;
	}
    }
    return join '',@OUT;
}
[/realperl]



__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/?.refer=text