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
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
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
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 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);
> 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
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"
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]
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
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
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().
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
>
>___
> 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.
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
--- 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 -
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
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:
>
>(
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
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
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
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
21 matches
Mail list logo