qw with strings containing spaces



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.

I've looked on PerlMonks and saw a solution which created a scalar with a string
containing each item separated by commas. It is then run through the split()
function using the commas as the delimiter. I'd like a more succinct and
cleaner method of doing this though, if possible.

Any ideas?

Mathew
--
Keep up with me and what I'm up to: http://theillien.blogspot.com
.



Relevant Pages

  • Bug+fix: PDC20271 RAID detection fails
    ... My array was not detected by my kernel. ... the PDC RAID superblock, that is located at the start ... of the last track on the disk. ... is a multiple of track size and if not, ...
    (comp.os.linux.hardware)
  • Re: Another Filegroup question
    ... I would suggest multiple filegroups only so it would be easier to ... small array as this I don't think multiple files will buy you anything. ... don't think you have too much of a choice if you only have 4 drives that are ...
    (microsoft.public.sqlserver.server)
  • Re: optimizing code segment
    ... > lookup is an array of unsigned ints ... > understand MMX is getting obsolete but SSE2 is not widespread on AMD ... You can use multiple movd instructions and then shuffles ...
    (comp.lang.asm.x86)
  • RE: Using Match function with duplicate values in an array
    ... > set up a helper column ... >> function to find the row reference in the array. ... >> are multiple equal values in the column. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: System call not acting as expected
    ... > perldoc -f system ... Why are you using commas there ... > logfile_dirs into an array, which seems likely, but I don't know your ... > all sorts of fun problems, like having to sort out terminal escape ...
    (comp.lang.perl.misc)