SPUG: Shouldn't this work?

Jim Flanagan jimfl at colltech.com
Thu Nov 29 15:06:55 CST 2001


--On Thursday, November 29, 2001 12:14 PM -0800 "Martin, Asa" 
<asa.martin at attws.com> wrote:

     > Am I missing something, or shouldn't this syntax be valid to create
     > a reference to an anonymous array:

  Yes, this shouldn't work. :^)

  The qw operator creates an array, not an arrayref. The qw operator is
  magical in that you can use a delimiter that is part of an open/close
  pair, like {}, [], (), or a 'unary' delimiter, like $$, %%, ##, //, ||,
  whatever. They all mean the same thing.

  You could use the following:

  $aref = [qw(these are the elements of my arrarref)];

-- 
Jim Flanagan
jimfl at colltech.com

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/





More information about the spug-list mailing list