in reply to SCALAR ref error help!
There are a few bad things going on. First, change the name of the sub to something else; "menu" is used by one of the other modules, and there is a name collision.
Second, $address doesn't get initialized anywhere. Third, don't print from the sub, return the value.
Last, the uri_escape interpolation seems to be wrong somehow, but I didn't try to rewrite it as is, because it's hard to read, and you're doing it three times needlessly. Instead, call it outside of the qq statement. Try something like this:
Main script:call_b.pl#!/usr/bin/perl -w use strict; use CGI qw(:standard); use URI::Escape; require "call_b.pl"; my $go_menu = &menu2; print "Content-type: text/html\n\n"; print $go_menu;
#!/usr/bin/perl -w use strict; use CGI qw(:standard); use URI::Escape; my $address = uri_escape("some address"); sub menu2 { return qq| <td> <ul> <li><a href="home.pl?contatc=$address&selected_tab=a" targ +et="_top">home<b></b></a></li> <li>etc..</li> </ul> </td> |; } 1;
|
|---|