[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
Re:[ic] session dump
thanks Christopher.It works fine now. Nice script you
made!
I can advice everyone to try this out, it really shows
a lot about what's going on whith interchange and can
be used as a nice debug feature. I resumed it here
below:
just enter in interchange.cfg:
#------------------------------
Usertag realperl HasEndTag
Usertag realperl CanNest
Usertag realperl Interpolate
Usertag realperl Routine <<EOF
sub {
my $str = eval {
eval $_[0] or die;
};
}
EOF
#-------------------------------
this defines the [realperl] tag.
Then make a normal interchange page in
catalogdir/pages whith the following content and open
it from your browser:
#!/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]
#Christopher F. Miller, Publisher cfm@maine.com
MaineStreet Communications, Inc 208 Portland Road,
Gray, ME 04039 1.207.657.5078 http://www.maine.com/
Content management,
#electronic commerce, internet integration, Debian
linux
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text
_______________________________________________
Interchange-users mailing list
Interchange-users@lists.akopia.com
http://lists.akopia.com/mailman/listinfo/interchange-users