Oct 27, 2012, 7:34 AM
Re: [PerlUser12] Meaning of -w and qw
The -w enables warnings, which is a very good thing to do because it point you to errors in your program, except that this is a slightly outdated (and somewhat deprecated) way of enabling the warnings. Nowodays, the best way to do it is to use the following pragma:
The qw (quote words) statement is synctatic sugar to define an array of strings.
@array = qw/foo bar . . ./;
@array = qw(foo bar . . .);
is the same as
@array = (’foo’, ’bar’,. . .).
Basically, you avoid having to type the single quotes and the commas. There is nothing more to it.
EDIT: Fishmonger was faster than me. ;-)
(This post was edited by Laurent_R on Oct 27, 2012, 7:37 AM)