in reply to How about class Foo {...} definition for Perl?

What if you get a file that you'd rather not change, but would like to modify. Or can't change because it is read only on a network file system. In some file that you can edit you can simply use a package statement and you can extend the existing class. I've used this technique to override code that I've gotten from CPAN. I forget the details, but I didn't like how Getopt::Long::configure() was working, so I added new methods to Getopt::Long that did what I needed *without modifying the original or breaking compatibility*.

I know that real solution to this is version control (I'm a ClearCase admin by day), but sometimes a quick and dirty proof of concept hack is easier. And for a one-of like this, why track a change that affects no one else?

- doug