Never used P4, but how I'd approach the problem (after doing everything you said you're doing) is to insert some logging statements into the code to ensure that $CL is set properly, for example. One popular log module is Log::Log4Perl, although I find it quite heavy. Regardless, what you want to do is show what $CL is right after the shift, show what @options is, right after the push, $errors right before the die, and @info right before the foreach.

Debugging tips aside, "$Components = $Components.$element" is easier said as "$Components .= $element". However, the entire foreach statement is easier said as "$Components = join '', @info". (I'm assuming $Components starts out empty - if that's not the case, change the = to .=)

Also, I'm not sure why you're clearing out @options - usually @options would not be global, so it would get cleared at the end of the routine anyway. But that's really not that important. Just that if it's not needed, it's clutter. Same for @info.


In reply to Re: Perl / Apache / P4 Problem by Tanktalus
in thread Perl / Apache / P4 Problem by fatherlyons

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.