Free Perl Tutorials

PERL qw Function

The qw function is useful in saving you time while programming with PERL. It is used when you are declaring arrays. Without the qw function, you would have to put all of your bits of information in quotes and separate each with a comma, like so:

@array = ("This", "Takes", "To", "Long!");

A much easier way to format this is to do the following while using the qw function:

@array = qw(This Takes To Long!);

They are both the exact same thing, but one requires significantly less work. I stuck with the first method for a while before moving over to the qw method, but I recommend picking up the qw function immediately as it will increase your productivity, and is easy to learn!