aboutsummaryrefslogtreecommitdiff
path: root/Perl/debug
diff options
context:
space:
mode:
authoretienne2003-06-17 16:13:19 +0000
committeretienne2003-06-17 16:13:19 +0000
commitec4faf5a4f88098f73123680ba275b2a3ea12b2a (patch)
tree9477e140d347747b5396f3f3089d243431dbeb28 /Perl/debug
parent3756e0088bed99e82f7726eaa08a80ccc888b296 (diff)
downloadtkzinc-ec4faf5a4f88098f73123680ba275b2a3ea12b2a.zip
tkzinc-ec4faf5a4f88098f73123680ba275b2a3ea12b2a.tar.gz
tkzinc-ec4faf5a4f88098f73123680ba275b2a3ea12b2a.tar.bz2
tkzinc-ec4faf5a4f88098f73123680ba275b2a3ea12b2a.tar.xz
*** empty log message ***
Diffstat (limited to 'Perl/debug')
-rw-r--r--Perl/debug/ZincTraceUtils.pm90
1 files changed, 0 insertions, 90 deletions
diff --git a/Perl/debug/ZincTraceUtils.pm b/Perl/debug/ZincTraceUtils.pm
deleted file mode 100644
index 60628a8..0000000
--- a/Perl/debug/ZincTraceUtils.pm
+++ /dev/null
@@ -1,90 +0,0 @@
-package ZincTraceUtils;
-
-use Tk;
-use strict;
-use Tk::Font;
-use Tk::Photo;
-use vars qw(@EXPORT);
-@EXPORT = qw(printItem printArray printList);
-
-
-### to print something
-sub printItem {
- my ($value) = @_;
- my $ref = ref($value);
-# print "VALUE=$value REF=$ref\n";
- if ($ref eq 'ARRAY') {
- printArray ( @{$value} );
- }
- elsif ($ref eq 'CODE') {
- print "{CODE}";
- }
- elsif ($ref eq 'Tk::Photo') {
-# print " **** $value ***** ";
- print "Tk::Photo(\"". scalar $value->cget('-file') . "\")";
- }
- elsif ($ref eq 'Tk::Font') {
- print "'$value'";
- }
- elsif ($ref eq '') { # scalar
- if (defined $value) {
- if ($value eq '') {
- print "''";
- } elsif ($value =~ /\s/
- or $value =~ /^[a-zA-Z]/
- or $value =~ /^[\W]$/ ) {
- print "'$value'";
- } else {
- print $value;
- }
- }
- else {
- print "undef";
- }
- }
- else { # some class instance
- return $value;
- }
-
-} # end printitem
-
-
-### to print a list of something
-sub printArray {
- my (@values) = @_;
- if (! scalar @values) {
- print "[]";
- }
- else { # the list is not empty
- my @res;
- print "[";
- while (@values) {
- my $value = shift @values;
- &printItem ($value);
- print ", " if (@values);
- }
- print "]" ;
- }
-
-} # end printArray
-
-
-sub printList {
- print "(";
- while (@_) {
- my $v = shift @_;
- printItem $v;
- if ($v =~ /^-\w+/) {
- print " => ";
- } elsif (@_) {
- print ", ";
- }
- }
- print ")";
-
-} # end printList
-
-1;
-
-
-