Re: qw : what is it
- --- In perl-beginner@y..., Abhra Debroy <abhra@p...> wrote:
> Hello AllWell, there is no qa(), but for qw:
> I know it is very silly question,still I am asking u all
> What is the full form of qa ? What does it means ? How it is different with
> normal array ( @arrray= qa( x y z))
qw = Q(uoted) W(ord list).
The following are mostly similar (have same output):
@x = split(/\s+/,'STRING1 STRING2 STRING3');
@x = qw(STRING1 STRING2 STRING3);
@x = ('STRING1', 'STRING2', 'STRING3');
With the last two being the most similar, because perl actually compiles the qw into the list like the last one.
See perldoc perlop.