Solved

PerlScript with ASP question

Posted on 2004-10-18
6
156 Views
Last Modified: 2010-03-05
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
0
Comment
Question by:astankovic
  • 2
  • 2
6 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 12339827
How are you defining $Session?
0
 
LVL 4

Author Comment

by:astankovic
ID: 12339868
$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
 
LVL 84

Expert Comment

by:ozo
ID: 12340049
$Session->{MyDictionary} = {MyItem => 'something'};
$something = $Session->{MyDictionary}{MyItem};
0
 
LVL 4

Author Comment

by:astankovic
ID: 12342263
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
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 12380992
Question answered by asker or dialog valuable.
Closed, 500 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now