0 votes
in Perl by
Write a program that explains the symbolic table clearly.

1 Answer

0 votes
by
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++;

}
...