From: Uri Guttman on
>>>>> "IZ" == Ilya Zakharevich <nospam-abuse(a)ilyaz.org> writes:

IZ> On 2010-07-23, Uri Guttman <uri(a)StemSystems.com> wrote:
>>>>>>> "D" == Dilbert <dilbert1999(a)gmail.com> writes:
>>
D> Let's hope that the surprising autovivification will be fixed in Perl
D> 5.14

>> let's hope not!

IZ> lets hope yes

>> exists was just a function that provided no information
>> to the hash expression it was checking.

IZ> ... which in 99.9999% of cases is not what the intent was.

and writing a deep exists is such an easy task anyhow. doing direct deep
exists is usually poor code as well. see my autovivication tutorial for
more and the code for a deep exists.

http://sysarch.com/Perl/autoviv.txt

uri

--
Uri Guttman ------ uri(a)stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
From: Dr.Ruud on
Dilbert wrote:
>> On Jul 23, 10:40 am, Dilbert <dilbert1...(a)gmail.com> wrote:

> http://perldoc.perl.org/5.8.8/functions/exists.html
>
>>> This surprising autovivification in what does not at first -- or even
>>> second -- glance appear to be an lvalue context may be fixed in
>>> a future release.
>
> Let's hope that the surprising autovivification will be fixed in Perl
> 5.14

It is not surprising, and it should not get changed.

$ perl -MData::Dumper -wle'
my $x;
print Dumper( $x ) if $x->{a}{b}{c}{d} or $x;
'
$VAR1 = {
'a' => {
'b' => {
'c' => {}
}
}
};


Insecurity about intermediate levels, just means that your model is wrong.

You can of course write your own deep_exists() to do what you think that
you need, but you really need to go back to the drawing board.

--
Ruud
From: Ilya Zakharevich on
On 2010-07-24, Uri Guttman <uri(a)StemSystems.com> wrote:
> >> exists was just a function that provided no information
> >> to the hash expression it was checking.
>
> IZ> ... which in 99.9999% of cases is not what the intent was.
>
> and writing a deep exists is such an easy task anyhow.

Technically: yes, and this is why Perl should provide this itself.

Yours,
Ilya
From: Ilya Zakharevich on
On 2010-07-24, Dr.Ruud <rvtol+usenet(a)xs4all.nl> wrote:
> Dilbert wrote:
>>> On Jul 23, 10:40 am, Dilbert <dilbert1...(a)gmail.com> wrote:
>
>> http://perldoc.perl.org/5.8.8/functions/exists.html
>>
>>>> This surprising autovivification in what does not at first -- or even
>>>> second -- glance appear to be an lvalue context may be fixed in
>>>> a future release.
>>
>> Let's hope that the surprising autovivification will be fixed in Perl
>> 5.14
>
> It is not surprising,

For each person for whom it is not surprising, how many for which it is?

Ilya
From: Willem on
<about exists autovivifying intermediates>

Ilya Zakharevich wrote:
) For each person for whom it is not surprising, how many for which it is?

For each person for whom it is surprising, how many for which it is not?


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT