[vox-tech] perl: quoting strings with spaces

Micah Cowan vox-tech@lists.lugod.org
Sat, 21 Jun 2003 18:57:02 -0700


Peter Jay Salzman writes:
 > sorry for the line length.
 > 
 > when using a quoting operator like qw and friends, how does one one
 > quote a string with spaces?   in the code snippet below, my code chokes
 > on "El Dorado".
 > 
 > i also tried
 > 
 > foreach my $county (qw/Amador Calaveras q+El Dorado+ Humboldt Lake Tehama Trinity/)
 > 
 > and expected it to work, but it didn't.

Lake Tehama also looks like a problem. Normally, I'd suggest doing:


What about (qw/Amador Calaveras/, 'El Dorado', qw/.../)

But qw doesn't really pack much punch for your case. Use just a
regular list of strings?

-Micah