"Sputnik" help  
Sputnik Help
Language Reference - Operators - Operator qw (Quick Array)

Operator qw

The Quick Array operator.

printr qw(foo bar baz);
// PRINTS
// Array
// (
//     [0] => foo
//     [1] => bar
//     [2] => baz
// )

This function is a quick way to specify a lot of little single-quoted words. For example, qw(foo bar baz) is equivalent to array("foo", "bar", "baz"). Using qw can make Sputnik scripts easier to read. You can actually use any set of delimiters, not just the parentheses.

It allows multiline too

printr qw(
            foo
            bar
            baz
         );
// PRINTS
// Array
// (
//     [cat] => meow
//     [dog] => woof
// )
Whitespace is ignored

Using a foreach loop

my $array = qw(This is a list of words without interpolation);
foreach (my $key in $array)
{
   say "Value is $key";
}
// PRINTS
// Value is This
// Value is is
// Value is a
// Value is list
// Value is of
// Value is words
// Value is without
// Value is interpolation

To see a list of all the operators go here.


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org