Loading ...
Sorry, an error occurred while loading the content.

Re: qw : what is it

Expand Messages
  • b_harnish
    ... Well, there is no qa(), but for qw: qw = Q(uoted) W(ord list). The following are mostly similar (have same output): @x = split(/ s+/, STRING1 STRING2
    Message 1 of 3 , Apr 1, 2002
    • 0 Attachment
      --- In perl-beginner@y..., Abhra Debroy <abhra@p...> wrote:
      > Hello All
      >
      > 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))

      Well, there is no qa(), but for qw:

      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.

      - Brian
    Your message has been successfully submitted and would be delivered to recipients shortly.