in reply to Getting Problem while retriving previous parameter from Session using perl

You cannot have multiple elements in a hash with the same key! The new value will overwrite the old value.

Save the old values as "testcasename_old" and "testcasever_old". So, at the beginning of your change_event subroutine you should retrieve the existing session values and save them under another name (see suggestions above) and only then save the new values under the "testcasename" and "testcasever"-keys.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

  • Comment on Re: Getting Problem while retriving previous parameter from Session using perl
  • Download Code

Replies are listed 'Best First'.
Re^2: Getting Problem while retriving previous parameter from Session using perl
by srins (Sexton) on Aug 18, 2006 at 11:55 UTC
    But i am not getting any value from the session,when i use
    if($mycart->sess_get_key_value($session, 'Testver')) { $cart_test=$mycart->sess_get_key_value($session, 'Testver'); %test_info = %$cart_testbed_info; } print "#########Retrive from cart"; print Dumper \%test_info; print "##########################";
    First time i will not get any value.But next time i should get the previous value.But i am not getting that value from seesion. Thanks, Srins.
      Did you try using one of the "standard" session modules, such as CGI::Session rather than rolling your own?

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law