John W. Krahn wrote:
> Mathew Snyder wrote:
>> I need to populate a select multiple on a web page when it loads with
>> a series
>> of values.  Most of the values will be determined dynamically when the
>> code runs
>> but some are static.  They look like "A - H", "I - P" and "Q - Z". 
>> The spaces
>> are for readability.
>>
>> What I am doing is declaring an array and assigning the value:
>> @array = qw/All "A - H" "I - P" "Q - Z"/;
>> and then pushing the to-be-determined values onto the array later on. 
>> However,
>> when I print this all out while testing, I get each letter, hyphen and
>> quote as
>> individual elements.  I've tried escaping different ways to no avail.
> 
> qw/All "A - H" "I - P" "Q - Z"/
> 
> is the same as saying:
> 
> split ' ', q/All "A - H" "I - P" "Q - Z"/
> 
> so when using qw// there are no strings just whitespace characters and
> non-whitespace characters.  What you want is:
> 
> my @array = ( 'All', 'A - H', 'I - P', 'Q - Z' );
> 
> 
> 
> John


Thanks John and Flemming.  Works now.

Mathew

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to