# Copyright (c) 1995-1999 Nick Ing-Simmons. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
use vars
qw($VERSION @EXPORT);
$VERSION = '3.013'; # $Id: //depot/Tk8/Tk/Pretty.pm#13 $
@EXPORT = qw(Pretty PrintArgs);
join(',',map(&Pretty
($_),@_));
return pretty_list
(@_) if (@_ > 1);
return 'undef' unless defined($obj);
return $type if ($type =~ /=HASH/ && exists($obj->{"_Tcl_CmdInfo_\0"}));
if ($type =~ /^([^=]+)=(.*)$/)
$result .= pretty_list
(@
$obj);
while (($key,$value) = each %$obj)
$result .= $key . '=>' . Pretty
($value) . ',';
$result .= "\\" . Pretty
($$obj);
elsif ($type =~ /^SCALAR/)
$result .= Pretty
($$obj);
$result .= ",$class)" if (defined $class);
if ($obj =~ /^-?[0-9]+(.[0-9]*(e[+-][0-9]+)?)?$/ ||
$obj =~ /^[A-Z_][A-Za-z_0-9]*$/ ||
$obj =~ /^[a-z_][A-Za-z_0-9]*[A-Z_][A-Za-z_0-9]*$/
$result .= "'" . $obj . "'";
my $name = (caller(1))[3];
print "$name(",Pretty
(@_),")\n";