Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2017-08-24 08:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (367 votes). Check out past polls.

    Notices?