=pod Build up our list of hashes from 14th Chart of the Nuclides data. =cut my $hydrogen = {}; { $hydrogen->{element}{Z} = 1; $hydrogen->{name}{default} = 'Hydrogen'; $hydrogen->{name}{'en-CA'} = 'Hydrogen'; # Names for other countries/languages/charactersets. $hydrogen->{symbol}{default} = 'H'; $hydrogen->{symbol}{'en-CA'} = 'H'; # Symbols for other countries/languages/charactersets. $hydrogen->{element}{mass} = Materia::Variable::Generic->new({ value => '1.00794(7)', name => 'MolarMass', units => 'g', }); $hydrogen->{boilT} = Materia::Variable::Pressure->new({ value => '20.268', name => 'BoilT', units => 'K', pressure => { value => '101.325E3', units => 'Pa', }, });

There are 106 elements of data, each one has a stanza about twice as long as this snippet for Hydrogen. The object is to merge a bunch of different data sources (some on paper, some electronically readable) into a database. But that is how this got to be almost 10,000 lines long.

But the first creation of a Generic object, to store the Molar Mass of Hydrogen works. The next object to be created, the Boiling Point of Hydrogen (at a pressure of 1 atmosphere) fails.

As written in the original note, the ::Generic, ::Pressure, ::Temperature and ::PressureTemperature modules have new methods. These methods do very little, mostly they shuffle a little information and call _init() in the base class.

Anytime I find a problem, I redo the make/make install of these modules, so that what this program is loading when I run perldb in emacs is up to date. I don't just rerun the program from the beginning, I kill the perldb session in emacs and start it over again. But I have never run into this before where it looks like I have loaded the module, but at run time it can't find it. It's strange.


In reply to Re^4: OO: short memory? by Anonymous Monk
in thread OO: short memory? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.