[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[FWP] Constants as array refs



Okay, this ought to be easy but it's not, and I'm just drawing a blank
today.

Given:

  use constant CARRAY => [1, 2, 3, 4];

What is the syntax to dereference this constant directly into the list of a
'foreach' loop?

None of these work:

  foreach (CARRAY)
  foreach (( CARRAY ))
  foreach (@{ CARRAY })
  foreach (@{[ CARRAY })

----
"The future masters of technology will have to be lighthearted and
intelligent.  The machine easily masters the grim and the dumb."
--Marshall McLuhan
___________________
Jeff Boes  <><  jboes@qtm.net
Mur Consulting  http://www.qtm.net/~jboes/


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe