--- 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 -w, it'll complain.

By the way, have we mentioned that you should always use strict.pm and
the -w switch? =o) lol....
 
> what does the qw do?

qw is the "Quote-Word" operator for perl. c.f. perldoc perlop

qw takes a list of whitespace-delimited strings and quotes them as if
they were each in singleticks. For example:

  @array = qw / a b c d e /;

creates an array of the alphabet's first 5 letters.
The slash isn't magical here; it's just one possible bounding
character. You can use matching pairs () {} <> [] or other things like
/ if those aren't convenient. 

So, to paraphrase the above,
 @array = qw( stuff moreStuff evenMoreStuff );

makes an array of those three elements, but the literal value above
would yield:
  "stuff",
  "more
  stuff",
  "even
  more
  stuff"

Notice that the quotes and commas are part of the strings, and that
"even more stuff" got split into three seperate elements of the array.

Does that help?
Is that the actual code you're looking at?
If not, post it, and let's take it apart! lol....



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to