Thank you for your suggestions. You are, without question, correct. This code is kludgy (at best). However, it does work in every instance but the one described. Given my deadline (which has passed, and testing is to begin with my customers on March 17th), it was the best I could come up with (as a beginner) and still make the boss happy.

I did try to use CGI::Session but had difficulty in getting that to work (see previous posts). I've been told not to use cookies or put the variables in the URL... so that left me with hidden variables (for now). Once the dust settles, I hope to drop back in to looking at a better way of maintaining persistence with these variables I need to track.

Believe me, I'm embarrassed by the lack of elegance of the code. I am very aware of how ugly and hard-to-maintain it is right now.

The variables involve numerous fields (we call them attributes) that appear on each page, plus a lot of them are used to narrow down the SQL criteria for subsequent database calls. If I had more time and more knowledge, I think I'll be able to improve the code to something a little less of an embarrassing first attempt.

The &call_vars sub was my attempt to bundle all my variables in a concatenated string to pass from page to page via a hidden field. I don't know how create a hash ref and treat the values as a bundle as you suggested.

Lori


In reply to Re: •Re: Sub call isn't returning values by Lori713
in thread Sub call isn't returning values by Lori713

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.