PerlScript with ASP question

Hi,

I have an ASP page that uses PerlScript. I also have a Dictionary object stored in a Session variable.
Now my questions is how can I set an item in the Dictionary object that is in a Session variable.

In VBScript that would be:
Session.Contents.Item("MyDictionary").Item("MyItem") = "something"

I tried:
$Session->Contents->Item('MyDictionary')->Item('MyItem') = 'something';
and
$Session->Contents->Item('MyDictionary')->SetProperty('Item', 'MyItem', 'something');

And it fails.

Thanks,
Alex
LVL 4
astankovicAsked:
Who is Participating?
 
ee_ai_constructConnect With a Mentor Commented:
Question answered by asker or dialog valuable.
Closed, 500 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0
 
ozoCommented:
How are you defining $Session?
0
 
astankovicAuthor Commented:
$Session is a "build in" object that is available to all ASP pages.

Remember, this is in a ASP page:

<%@ LANGUAGE = "PerlScript" %>
<%
 #PerlScript code here
%>

Alex
0
 
ozoCommented:
$Session->{MyDictionary} = {MyItem => 'something'};
$something = $Session->{MyDictionary}{MyItem};
0
 
astankovicAuthor Commented:
Tried it and it doesn't seem to work.

However, this:

$my_dict = $Session->Contents('MyDictionary');
$my_dict->SetProperty('Item', 'MyItem', 'something');

seems to do the job.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.