Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: conditional statements in list constructors

by SuicideJunkie (Vicar)
on Mar 27, 2014 at 14:59 UTC ( [id://1079939]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $pi = 0;
    my $life = 'isgood';
    my $foo = 1;
    my $aref = [ (3,1,4) x !!($pi), (42) x !!($life), ('bar', 'baz') x !!(
    +$foo)  ];
    print Dumper $aref;
    
  2. or download this
    $VAR1 = [
              42,
              'bar',
              'baz'
            ];
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-25 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found