$pgn->comments was Re: DCPM: perltutopen blues....

Simon Waters Simon at wretched.demon.co.uk
Wed Jul 9 09:24:45 CDT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matthew Browning wrote:
>
>   $pgn->{GameComments}->{++$key} = 'comment';

Thanks Matthew, but as I said "I'm poking data straight into an objects
private areas", as I'd already written;

if (!(defined $pgn->comments)){
my %empty;
$pgn->{GameComments}=\%empty;
... }

Which I think was fine because a hash array happens to be the default
type expected for the polymorphic chess game object, apart from breaking
information hiding<oops>.

I finally explained what I wanted to Giuseppe, and he added an
"add_comment" method to Parse.pm version 16, so no need to break any OO
rules just as soon as CPAN catches up.
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/DCWrGFXfHI9FVgYRAokMAJsGUHX27QJP9P7C8621/HSfvS7KtwCghqW8
ZjzT4S3R+5oHYy9sREy3MZE=
=itxi
-----END PGP SIGNATURE-----



More information about the Devoncornwall-pm mailing list