himanshu.padmanabhi, you're post is confusing. Take a look at How do I post a question effectively?. Taken as it's written, what you're asking is odd - since the Javascript is client-side (browser) and perl is server-side (web server) and the two normally do not run together in the same process -- unless you have some funky Inline thing happening or you're doing something wild like using Javascript to create perl code.
| [reply] |
And, anyway, %hash = {} does not do what himanshu.padmanabhi think it does. To clear a hash in perl, we do:
%hash = ()
orundef %hash
or, if $hash is a hash reference,%$hash = ()
or, somewhat similarly but not exactly the same,$hash = {}
or, also somewhat similarly but not exactly the same,undef $hash
[]s, HTH, Massa (κς,πμ,πλ)
| [reply] [d/l] [select] |
hash={};
--
Ronald Fischer <ynnor@mm.st>
| [reply] [d/l] |
That's how you would clear a Javascript object (which may be what the OP is after, who knows) but not a perl hash *in* Javascript.
| [reply] |
x=new Object
you can already use it as associative array in Javascript.:
x['foo']='bar'
</p>
I just find the syntax
<c>
x={}
nicer. See for instance http://www.quirksmode.org/js/associative.html.
--
Ronald Fischer <ynnor@mm.st>
| [reply] [d/l] [select] |