in reply to Re^2: Conditional array initialisation?
in thread Conditional array initialisation?
The old use of defined @arr is deprecated, cause the logic was broken.
For me undefined means "not initialized" (yet), like with my $a. But this state doesn't exist for array and hashes, they are initialized empty.
And if it existed it would be different from (defined and) empty.
Nevertheless undef @a is allowed, adding even more confusion:
DB<153> @a => (1, 2, 3, 4, 5, 6) DB<154> undef @a => undef DB<155> \@a => []
Cheers Rolf
( addicted to the Perl Programming Language)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Conditional array initialisation? (Question expanded)
by BrowserUk (Patriarch) on Jul 12, 2013 at 21:24 UTC | |
by tye (Sage) on Jul 13, 2013 at 02:16 UTC | |
by Athanasius (Archbishop) on Jul 13, 2013 at 03:49 UTC | |
by tye (Sage) on Jul 13, 2013 at 05:12 UTC | |
by BrowserUk (Patriarch) on Jul 13, 2013 at 03:28 UTC | |
by tye (Sage) on Jul 13, 2013 at 05:23 UTC |
In Section
Seekers of Perl Wisdom