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

Re: Conditinal array initialisation?

by hdb (Prior)
on Jul 12, 2013 at 17:18 UTC ( #1044034=note: print w/ replies, xml ) Need Help??


in reply to Conditional array initialisation?

From defined:

Use of defined on aggregates (hashes and arrays) is deprecated. It used to report whether memory for that aggregate had ever been allocated. This behavior may disappear in future versions of Perl.


Comment on Re: Conditinal array initialisation?
Re^2: Conditinal array initialisation?
by CountZero (Bishop) on Jul 12, 2013 at 19:06 UTC
    The explanation is even more confusing than the question.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics
Re^2: Conditional array initialisation?
by BrowserUk (Pope) on Jul 12, 2013 at 19:23 UTC

    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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2014-09-21 00:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (165 votes), past polls