spewn
Programmer
- May 7, 2001
- 1,034
i have one file, map.pl, that runs a script. it requires subs.pl, which i include.
the above url is what i use to initiate the program.
the code takes the name=value pairs and should use them in the script.
the map.pl calls a subroutine, which is written on subs.pl.
the codes are as follows...
_____________________________
# map.pl
#!/usr/local/bin/perl
use strict;
use CGI qwstandard :html3);
require "subs.pl";
if ( param() ) {
my $mn = param("mn"
my $sn = param("sn"
my $url = param("url"
&eyc_html;
} else { yada, yada, yada....}
print end_html();
****
_____________________________
# subs.pl
****
sub eyc_html {
print <<EOP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"
<HTML>
<HEAD>
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=ISO-8859-1">
<script language="javascript">mn='$mn';sn='$sn';url='$url';</script>
</body>
</html>
EOP
}
1;
****
_____________________________
question....how do i get the value of the variables, ($mn, $sn, $url) into the subroutine? as you can see, the value of the info passed through perl becomes the new local page variables in javascript, (shown in bold letters). i tried, (as you see above)
and also tried to change the variables from 'my' to 'local', but no luck.
right now, as it rights the page from eyc_html, it just leaves the js variables blank.
(it shows this:
<script language="javascript">mn='';sn='';url='';</script>
no values passed.)
also, what's the difference between:
my $variable =
local $variable =
$variable =
i'm confused on this. -c
pss! i tried adding %60 to each value, like
and then took the '' marks out at subs.pl like
<script language="javascript">mn=$mn;sn=$sn;url=$url;</script>
figuring that since %60 is a ' mark anyway...that seems to work, but then it only reads the '' marks.
someone has to know what i am doing wrong. -c
the above url is what i use to initiate the program.
the code takes the name=value pairs and should use them in the script.
the map.pl calls a subroutine, which is written on subs.pl.
the codes are as follows...
_____________________________
# map.pl
#!/usr/local/bin/perl
use strict;
use CGI qwstandard :html3);
require "subs.pl";
if ( param() ) {
my $mn = param("mn"
my $sn = param("sn"
my $url = param("url"
&eyc_html;
} else { yada, yada, yada....}
print end_html();
****
_____________________________
# subs.pl
****
sub eyc_html {
print <<EOP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"
<HTML>
<HEAD>
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=ISO-8859-1">
<script language="javascript">mn='$mn';sn='$sn';url='$url';</script>
</body>
</html>
EOP
}
1;
****
_____________________________
question....how do i get the value of the variables, ($mn, $sn, $url) into the subroutine? as you can see, the value of the info passed through perl becomes the new local page variables in javascript, (shown in bold letters). i tried, (as you see above)
and also tried to change the variables from 'my' to 'local', but no luck.
right now, as it rights the page from eyc_html, it just leaves the js variables blank.
(it shows this:
<script language="javascript">mn='';sn='';url='';</script>
no values passed.)
also, what's the difference between:
my $variable =
local $variable =
$variable =
i'm confused on this. -c
pss! i tried adding %60 to each value, like
and then took the '' marks out at subs.pl like
<script language="javascript">mn=$mn;sn=$sn;url=$url;</script>
figuring that since %60 is a ' mark anyway...that seems to work, but then it only reads the '' marks.
someone has to know what i am doing wrong. -c