Click here to Skip to main content
15,894,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
the following code throws an error as follows:

Global symbol "%href_to_what" requires explicit package


How can i fix it?

What I have tried:

<pre>while (my $line=<$fh>) {
    chomp $line;
    for($line)
    {
    s/\&//g;
    s/[\\\_\@\_]//g;
    s/COMMENT//g;
    }
    my @data = split /:/, $line;
    my $class = $data[0] ? 'normal' : 'bold';
    print $fh_out qq[<tr class="$class">];
    my $ct=0; 
    for my $word(@data){ 
      $ct++; 
      print $fh_out '<td>';
      if ($ct==1){ 
          print $fh_out '<a href="'
                       .$href_to_what{$word}
                       .'">'; 
          } 

      print $fh_out $word; 
      if ($ct==1){ 
          print $fh_out '</a>';
          } 
      print $fh_out '</td>'; 
      } 
    print $fh_out "</tr>\n";
    } 
Posted
Updated 9-Mar-17 21:54pm
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900