Re: qw with strings containing spaces

2007-08-09 Thread usenet
On Aug 9, 11:58 am, [EMAIL PROTECTED] (Mathew Snyder) wrote: > What I am doing is declaring an array and assigning the value: > @array = qw/All "A - H" "I - P" "Q - Z"/; You don't want qw{} here. Just do it the brute-force way: @array = ("All", "A - H", "I - P", "Q - Z"); -- The best way to

Re: qw with strings containing spaces

2007-08-09 Thread Mathew Snyder
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 space

Re: qw with strings containing spaces

2007-08-09 Thread John W. Krahn
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

Re: qw with strings containing spaces

2007-08-09 Thread Flemming Greve Skovengaard
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

RE: qw versus qx

2003-07-24 Thread Dan Muey
> > Is qw for holding list of data and qx is for running > commands? Do they both indicate a list context? Thanks, John perldoc -f qq perlop "Regexp Quote-Like Operators" my @stuff = qw(hi bye joe mama); my @cmdln = qx(cat monkey.txt| grep fred); my $cmdln = qx(cat monkey.txt| grep fred);

RE: qw versus qx

2003-07-24 Thread Hanson, Rob
> Is qw for holding list of data and qx is for running commands? yes. > Do they both indicate a list context? no. qw{word word} is the same as ('word', 'word')... and qx{foo bar} is the same as `foo bar`. qx{} is just there if you need an alternate syntax to ``, like if you needed to use a bac

Re: qw for variables?

2002-02-19 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Dennis G. Wicks" <[EMAIL PROTECTED]>: > Greetings; > > I can get qw to work for things like > > @n = qw( john jacob jingleheimer schmidt ); > > but something like > > @n = qw( $names ); > > doesn't work. I get the literal string "$names"

Re: qw for variables?

2002-02-19 Thread Dennis G. Wicks
The split did the trick, and cut out a few lines of code also. I had already done some splits and joins to get ready for qw() which I can n ow delete! Thanks for the help everyone! Dennis -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: qw for variables?

2002-02-19 Thread Johnathan Kupferer
Dennis G. Wicks wrote: >Greetings; > >No, I mean if $names contains "Jesus Mary Joseph" and I do > > my @n = qw( $names ); > >I want the same results as if I had done > > my @n = qw( Jesus Mary Joseph ); > >Obviously qw() does not work this way, but I can't find the >equivalent that d

RE: qw for variables?

2002-02-19 Thread Nikola Janceski
you want split then.. my $names = "Jesus Mary Joseph"; my @n = split /\s+/, $names; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 19, 2002 3:08 PM To: [EMAIL PROTECTED] Subject: Re: qw for variables? Greetings; No, I mean

Re: qw for variables?

2002-02-19 Thread Jeff 'japhy' Pinyan
On Feb 19, Dennis G. Wicks said: >No, I mean if $names contains "Jesus Mary Joseph" and I do > > my @n = qw( $names ); > >I want the same results as if I had done > > my @n = qw( Jesus Mary Joseph ); There's no quoting operator that will do that for you. I'd suggest using split().

Re: qw for variables?

2002-02-19 Thread Dennis G. Wicks
is >}On Feb 19, 17:47, "=?iso-8859-1?q?Jonathan=20E.=20Paton?=" wrote: >} Subject: Re: qw for variables? >> What does the equivalent of qw(???) for a variable? > >You mean like: > >my @array = ($var1, $var2, $var3); > >Jonathan Paton > >___

Re: qw for variables?

2002-02-19 Thread Jonathan E. Paton
> What does the equivalent of qw(???) for a variable? You mean like: my @array = ($var1, $var2, $var3); Jonathan Paton __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.

RE: qw for variables?

2002-02-19 Thread Nikola Janceski
qw( john jacob $name ) is equivelent to ('john', 'jacob', '$name') notice the single quote. The single quotes does not interpolate (use the special meanings of special charaters, so the $ doesn't designate a varible name it's just a $ character). see man perlop or perldoc perlop -Original

Re: qw

2001-05-30 Thread Paul
--- Nichole Bialczyk <[EMAIL PROTECTED]> wrote: > i'm trying to work my way throuh an existing script and it says > @array = qw("stuff", "more stuff", "even more stuff"); That looks like a typo, though they may have actually wanted the quotes and commas in the strings if you run that under -

Re: qw

2001-05-30 Thread Walt Mankowski
On Wed, May 30, 2001 at 03:38:35PM -0500, Nichole Bialczyk wrote: > i'm trying to work my way throuh an existing script and it says > > @array = qw("stuff", "more stuff", "even more stuff"); > > what does the qw do? In your example, it's a broken way of trying to say: $array[0] = "stuff"; $arr

RE: qw

2001-05-30 Thread Jeffrey Goff
Yep,caught that myself a few minutes -after- sending email. Apologies. -Original Message- From: Jeff Pinyan [mailto:[EMAIL PROTECTED]] On May 30, Jeffrey Goff said: >It's a shortcut for assigning words to an array. That statement would return >an array that looks roughly like this: > >(

RE: qw

2001-05-30 Thread Jeff Pinyan
On May 30, Jeffrey Goff said: >It's a shortcut for assigning words to an array. That statement would return >an array that looks roughly like this: > >('"stuff",', '"more stuff",', '"even more stuff"') # Note the double quotes. Nope, no matter what you do, qw() really splits on whitespace. f

Re: qw

2001-05-30 Thread Michael Fowler
On Wed, May 30, 2001 at 03:38:35PM -0500, Nichole Bialczyk wrote: > i'm trying to work my way throuh an existing script and it says > > @array = qw("stuff", "more stuff", "even more stuff"); > > what does the qw do? perldoc perlop: qw/STRING/ Returns a list of the words ex

RE: qw

2001-05-30 Thread Larry Shatzer
Here is the documentation on it. ( http://www.perldoc.com/perl5.6/pod/perlop.html#qw%2fSTRING%2f ) qw/STRING/ Evaluates to a list of the words extracted out of STRING, using embedded whitespace as the word delimiters. It can be understood as being roughly equivalent to: split(' ', q/STRING

RE: qw

2001-05-30 Thread Jeffrey Goff
It's a shortcut for assigning words to an array. That statement would return an array that looks roughly like this: ('"stuff",', '"more stuff",', '"even more stuff"') # Note the double quotes. Something like ("stuff","more stuff","even more stuff"); # was likely intended, without qw(). Search f