Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Conditional array initialisation?

by LanX (Canon)
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 studying the Monastery: (6)
As of 2014-08-01 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (257 votes), past polls