I wasn't able to post the actual code sooner because I didn't have my laptop where the code was. I know this post is a bit late, so I hope someone who knows more than me sees this.
sub build_evntype {
my @event_entries;
my @event_list=("Event1", "Event2");
my $p_event = shift;
for (my $i=0; $i<=$#event_list; $i++) {
my $event_data={};
$$event_data{"t_event"}=$event_list[$i];
$$event_data{"n_event"}=$i+1;
if ($i+1 == $p_event) {
$$event_data{"sel"} = "selected";
}
push (@event_entries, $event_data);
}
return \@event_entries;
}
I am using the same type of code to build 6 other select lists in my template, and they all work fine.
To fix my problem, I didn't touch the code, I just changed the name of the TMPL_LOOP, and it worked. I agree that it doesn't make sense, I am only interpreting the information I have at hand.
Thanks for all your insight,
digger
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|