Re: print statement creates key in hash with reference to empty array??



>>>>> "r" == rhorizon74 <rhorizon74@xxxxxxxxx> writes:

r> Id rather have my program fail, most scripting languages would print an
r> error (they would not seg-fault). That would be better than giving
r> incorrect results.

incorrect results? by whose definition are the results incorrect? you
didn't read the docs to understand autoviv and assumed incorrect
behavior. i lay that on you and not perl.

r> Moral of the story is i need to do an exists before i do anything with
r> any hash related structure in perl.

the real moral is you haven't learned yet how to work with perl data
structures. needing to print low level entries is very unusual. that
leads me to suspect the quality of your structure's design. i have done
many deep structures and never have come across this need. usually
something at a higher level can be done so you don't need to directly
access missing elements and thereby cause autoviv to happen.

until you learn more about perl and its data structures you will be
doomed to this poor style of design and coding.

and read my article already. it was written specifically for you.

uri

--
Uri Guttman ------ uri@xxxxxxxxxxxxxxx -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
.



Relevant Pages

  • Re: Simple code runs on linux, but not on windows -- why?
    ... > I believe that that is incorrect. ... > Whereabouts in perlsyn, exactly? ... Future versions of perl might do something different from the ...
    (comp.lang.perl.misc)
  • Re: times() returns incorrect value?
    ... but these values seems to be incorrect. ... real    0m13.126s ... I compled and installed Perl 5.10 from source, ... I can observe the same behavior only with a high machine load (e.g., ...
    (comp.lang.perl.misc)
  • Re: Parsing a text file line-by-line: skipping badly-formed lines?
    ... My fault, I should have been more precise. ... actually returns 0 but I know that is incorrect because the output ... This is perl, v5.8.4 built for i386-linux-thread-multi ... split suffers the same problem, i.e. it only gets so far through the ...
    (comp.lang.perl.misc)
  • Re: perl OOP
    ... It's not a matter of belief. ... How is someone less familiar with Perl to ... What benefit do you see in misleading him with incorrect ... Web Hosting by West Virginians, ...
    (comp.lang.perl.misc)
  • Re: array help
    ... This guess is incorrect. ... YOU did something wrong, not Perl. ... the scope of line 24". ... Paul Lalli ...
    (perl.beginners)