In Perl, the symbol table is a hash that contains the list of all the names defined in a namespace and it contains all the functions and variables. For example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
subSymbols
{
my($hashRef)=shift;
my(%sym);
my(@sym);
%sym=%{$hashRef};
@sym=sort(keys(%sym));
foreach(@sym)
{
printf("%-10.10s| %s\n",$_,$sym{$_});
}
}
Symbols(\%Foo::);
packageFoo;
$bar=2;
subbaz{
$bar++;
}
|