Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Conditional array initialisation?

by LanX (Chancellor)
on Jul 12, 2013 at 19:38 UTC ( #1044063=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      DB<125> @a=()
    
    ...
    
      DB<127>  @a  = (@a || ( 4..6 ));
     => 3
    
  2. or download this
      DB<138> @a=()
    
    ...
    
      DB<144> \@a
     => [1, 2, 3, 4, 5, 6]
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1044063]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2016-02-14 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (471 votes), past polls