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++;

}

Related questions

+2 votes
asked Feb 15, 2021 in Python by SakshiSharma
+3 votes
asked May 12, 2021 in JAVA by rajeshsharma
...