Hi there!

OK, of course, what you are asking for is:

# a hash (most important data type!) # ASP code # if session(strname)="" then # session(strname) = 0 # end if my %session = give_me_my_session( $this_is_who_i_am ); if ( not exists $session{$strname} or $session{$strname} eq '' ) { $sesssion{$strname} = 0; }

Of course, the trick is those give_me_...() and $this_is_... A nice trick if you are using Apache with mod_perl is using Apache::ASP. It gives you a complete ASP environment to program in Perl. It's almost a one-by-one map of ASP objects, thus translating an ASP to a Perl script could almost be done automatically (add sigils where they correspond, change . for -> in ASP objects method calls, and the VB or JS constructs to Perl ones.

By the way, if you can start from scratch, your script will be much cleaner and idiomatic (if you're good at Perl), and you can actually leave the whole ASP mess out and use CGI::Session as suggested by another monk.

If you rather not start all over, Apache::ASP can come very handy (get it from CPAN, of course).

Good luck,

--
our $Perl6 is Fantastic;


In reply to Re: session variables in cgi by Excalibor
in thread session variables in cgi by chuleto1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.