cLive ;-) has asked for the wisdom of the Perl Monks concerning the following question:
I want to create a hash on the fly in the middle of a large CGI print statement. I can easily do it outside of the print statement, but within the print statement I can only do it like this:
print $q->p( $q->scrolling_list( -name => 'list_input', -values => [0..$#array], -size => 1, -labels => { # yuck, using uninitialized global map { $::i++, $_ } @array } ) );
and I shudder at the thought of using a global. Any other suggestions on how to do this, or should I quit being lazy and just build the hash outside the print statement :) ?
cLive ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: lazy map question
by diotalevi (Canon) on Mar 15, 2004 at 19:34 UTC | |
by cLive ;-) (Prior) on Mar 15, 2004 at 19:44 UTC | |
|
Re: lazy map question
by BrowserUk (Patriarch) on Mar 15, 2004 at 19:34 UTC | |
|
Re: lazy map question
by iburrell (Chaplain) on Mar 15, 2004 at 22:26 UTC | |
|
Re: lazy map question
by waswas-fng (Curate) on Mar 15, 2004 at 19:35 UTC | |
|
Re: lazy map question
by cormac (Acolyte) on Mar 15, 2004 at 21:02 UTC | |
|
Re: lazy map question
by cLive ;-) (Prior) on Mar 15, 2004 at 19:43 UTC |