Programming Languages
C++
Subjective
Mar 13, 2013
Write a program that explains the symbolic table clearly.
Detailed Explanation
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:
sub Symbols
{
my($hashRef) = shift;
my(%sym);
my(@sym);
%sym = %{$hashRef};
@sym = sort(keys(%sym));
foreach (@sym)
{
printf("%-10.10s| %s\n", $_, $sym{$_});
}
}
Symbols(\%Foo::);
package Foo;
$bar = 2;
sub baz {
$bar++;
}
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts