Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Conditional array initialisation?

by BrowserUk (Pope)
on Jul 12, 2013 at 19:23 UTC ( #1044056=note: print w/ replies, xml ) Need Help??


in reply to Re: Conditinal array initialisation?
in thread Conditional array initialisation?

That it doesn't work is clear.

But, the semantics seem very clear, and the implementation trivial (roughly, without the need for copying):

undef @a; @a = @a ? @a : (1..3); say @a;; 1 2 3 @a = (4..6); @a = @a ? @a : (1..3); say @a;; 4 5 6

So I wondered why it isn't implemented so?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re^2: Conditional array initialisation?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2014-12-21 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (107 votes), past polls