#!/usr/bin/perl
# $Id: typeglob.pl,v 1.1.1.1 2008/10/12 04:05:34 alamos Exp $

#A typeglob is a hash table
$x=7;
@x=(1,2,3);
%x=(a=>1, b=>2, c=>3);
sub x {return 'something';};
## Note: open(x,...) does not set IO component of typeglob
## when sub x {...} is performed(???)
open(*x, "/tmp/foobar");
format x =
----------FORMAT------
.
print "--Symbol table entry properties:\n";
## Dump all known types (IO is synonymous with deprecated FILEHANDLE)
foreach (qw(SCALAR ARRAY HASH CODE GLOB FILEHANDLE IO NAME PACKAGE FORMAT)) {
    print "$_=======>", *main::x{$_},"\n";
}
print "--A different way to (partly) achieve the same:\n";
print "SCALAR=======>", \$x, "\n";
print "ARRAY=======>", \@x, "\n";
print "HASH=======>", \%x, "\n";
print "CODE=======>", \&x, "\n";
print "GLOB=======>", \*x, "\n";
close(x);
