On Mon, 01 Feb 2010 23:19:27 -0800, venu madhav wrote:

> Hi All,
>         I've a situation where I create a hash variable in PERL and
> use it in Java script which is embedded in the CGI. The key for that
> hash is taken from JavaScript. For ex:
> 
> ----- CGI code----
> my %hash{3}=300;
> ------JScript code---
> var var1 = 3;
> var variable = $hash{var1};
> ------------------------
>            When I run such a script, it is failing at the 3rd
> statement above. Can someone help me in resolving this?

No, your error is on the first line above. It has a syntax error and does 
not compile.

Get your program running from the command line first and check the
JavaScript output by hand to see whether it wrote out what you thought
it should.  Then put that output into a static page and check that your 
browser loads and execute it correctly.  You are not ready to take all 
these steps at once.

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/
http://www.informit.com/store/product.aspx?isbn=0137001274

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to