develooper Front page | perl.perl5.porters | Postings from November 2001

Re: restricted hashes, and other readonlyness (was "clamp...")

Thread Previous | Thread Next
From:
Graham Barr
Date:
November 4, 2001 19:02
Subject:
Re: restricted hashes, and other readonlyness (was "clamp...")
Message ID:
20011105030252.J53751@pobox.com
On Sat, Nov 03, 2001 at 06:57:34PM +0000, Nick Ing-Simmons wrote:
> >A sort grep through some common libraries quickly yields a few
> >likely candidates:
> >      the various IO::Socket objects
> 
> There are only two occurances of 'delete' in those - and in both cases
> the hash in question seems to be the creation arg list - not the 
> object - the caller is unlikely to have restricted the arg list for us ...
> 
> >      Net::FTP object
> 
> A possible - Graham care to comment?

the only classes I can think of where you would want to restrict the keys
are ones where you want to prohibit sub-classes. Net::FTP is a sub-class
of IO::Socket::INET, so IO::Socket::INET cannot be restricted and I have
seen people sub-class Net::FTP too.

Graham.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About