Prev: Confusion about the smart matching operator
Next: FAQ 5.19 How can I open a file with a leading ">" or trailing blanks?
From: Uri Guttman on 24 Jul 2010 02:53 >>>>> "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 24 Jul 2010 08:09 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 25 Jul 2010 07:26 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 25 Jul 2010 07:28 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 25 Jul 2010 08:02 <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
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Confusion about the smart matching operator Next: FAQ 5.19 How can I open a file with a leading ">" or trailing blanks? |