Forum Moderators: coopster & phranque

Message Too Old, No Replies

acess local variable made by perl in embedded javascript

         

rbigos

7:49 am on Jul 18, 2005 (gmt 0)

10+ Year Member



#!/usr/bin/perl -wT
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);

# my local variable i just created now.
$myLocal = 'done';

#here embedded javascript

print "Content-type:text/html\n\n";
print <<'ending_print_tag';

<html>
<head>
<title>script</title>
<script type="text/javascript" language="JavaScript">
<!--
// well how can i access $myLocal here here?
//thank you for your respond.

wruppert

12:19 pm on Jul 18, 2005 (gmt 0)

10+ Year Member



By placing your here doc tag in single quotes, you are suppressing the normal double quoting action of a here doc.

Change
print <<'ending_print_tag';

To:
print <<ending_print_tag;

and variables will be interpolated as they are in a double quoted string.

I hope this is answering the correct question...

rbigos

10:35 am on Jul 19, 2005 (gmt 0)

10+ Year Member



thank you for replaying.

bless the ALL.